commands: Make the hugo command non-global

See #4598
This commit is contained in:
Bjørn Erik Pedersen
2018-04-10 09:19:26 +02:00
parent 018602c46d
commit 4d32f2fa89
23 changed files with 299 additions and 336 deletions

View File

@@ -35,27 +35,23 @@ import (
jww "github.com/spf13/jwalterweatherman"
)
var _ cmder = (*newThemeCmd)(nil)
var _ cmder = (*importCmd)(nil)
type importCmd struct {
cmd *cobra.Command
}
func (c *importCmd) getCommand() *cobra.Command {
return c.cmd
*baseCmd
}
func newImportCmd() *importCmd {
cc := &importCmd{}
cc.cmd = &cobra.Command{
cc.baseCmd = newBaseCmd(&cobra.Command{
Use: "import",
Short: "Import your site from others.",
Long: `Import your site from other web site generators like Jekyll.
Import requires a subcommand, e.g. ` + "`hugo import jekyll jekyll_root_path target_path`.",
RunE: nil,
}
})
importJekyllCmd := &cobra.Command{
Use: "jekyll",
@@ -74,9 +70,6 @@ Import from Jekyll requires two paths, e.g. ` + "`hugo import jekyll jekyll_root
}
func init() {
}
func (i *importCmd) importFromJekyll(cmd *cobra.Command, args []string) error {
if len(args) < 2 {