shithub: hugo

Download patch

ref: e7010c1b621d68ee53411a5ba8143d07b976d9fe
parent: f396cffa239e948075af2224208671956d8b4a84
author: Bjørn Erik Pedersen <[email protected]>
date: Wed Apr 11 06:15:01 EDT 2018

commands: Remove some TODOs

See #4598

--- a/commands/commands.go
+++ b/commands/commands.go
@@ -75,22 +75,11 @@
 	return bcmd
 }
 
-// TODO(bep) cli refactor need root?
 func (c *baseCmd) flagsToConfig(cfg config.Provider) {
 	initializeFlags(c.cmd, cfg)
 }
 
 type hugoCmd struct {
-
-	//cacheDir        string
-	//contentDir      string
-	//layoutDir       string
-	//destination     string
-	//theme           string
-	//themesDir       string
-	//logI18nWarnings bool
-	//disableKinds []string
-
 	*baseBuilderCmd
 }
 
--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -53,20 +53,6 @@
 
 // TODO(bep) cli refactor consider a exported Hugo() method to fix the API
 
-// Hugo represents the Hugo sites to build. This variable is exported as it
-// is used by at least one external library (the Hugo caddy plugin). We should
-// provide a cleaner external API, but until then, this is it.
-// TODO(bep)  cli refactor remove this
-//var Hugo *hugolib.HugoSites
-
-// Reset resets Hugo ready for a new full build. This is mainly only useful
-// for benchmark testing etc. via the CLI commands.
-// TODO(bep) cli refactor check usage
-func Reset() error {
-	//Hugo = nil
-	return nil
-}
-
 // Execute adds all child commands to the root command HugoCmd and sets flags appropriately.
 func Execute() {
 	hugoCmd := newHugoCompleteCmd()
--- a/commands/list.go
+++ b/commands/list.go
@@ -150,7 +150,6 @@
 		},
 	)
 
-	// TODO(bep) cli refactor
 	cc.cmd.PersistentFlags().StringVarP(&cc.source, "source", "s", "", "filesystem path to read files relative from")
 	cc.cmd.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{})
 
--- a/commands/new.go
+++ b/commands/new.go
@@ -53,7 +53,6 @@
 	})
 
 	cc.cmd.Flags().StringVarP(&cc.contentType, "kind", "k", "", "content type to create")
-	// TODO(bep) cli refactor
 	cc.cmd.PersistentFlags().StringVarP(&cc.source, "source", "s", "", "filesystem path to read files relative from")
 	cc.cmd.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{})
 	cc.cmd.Flags().StringVar(&cc.contentEditor, "editor", "", "edit new content with this editor, if provided")
@@ -169,7 +168,6 @@
 	}
 }
 
-// TODO(bep) cli refactor => method
 func newContentPathSection(path string) (string, string) {
 	// Forward slashes is used in all examples. Convert if needed.
 	// Issue #1133
--- a/commands/new_content_test.go
+++ b/commands/new_content_test.go
@@ -48,7 +48,6 @@
 }
 
 func TestDoNewSite(t *testing.T) {
-	// TODO(bep) cli refactor
 	n := newNewSiteCmd()
 	basepath := filepath.Join("base", "blog")
 	_, fs := newTestCfg()
--- a/commands/release.go
+++ b/commands/release.go
@@ -22,11 +22,6 @@
 	"github.com/spf13/cobra"
 )
 
-func init() {
-	// TODO(bep) cli refactor
-	//HugoCmd.AddCommand(createReleaser().cmd)
-}
-
 type releaseCommandeer struct {
 	cmd *cobra.Command
 
--- a/commands/server.go
+++ b/commands/server.go
@@ -85,7 +85,6 @@
 		RunE: cc.server,
 	})
 
-	// TODO(bep) cli refactor fields vs strings
 	cc.cmd.Flags().IntVarP(&cc.serverPort, "port", "p", 1313, "port on which the server will listen")
 	cc.cmd.Flags().IntVar(&cc.liveReloadPort, "liveReloadPort", -1, "port for live reloading (i.e. 443 in HTTPS proxy situations)")
 	cc.cmd.Flags().StringVarP(&cc.serverInterface, "bind", "", "127.0.0.1", "interface to which the server will bind")
@@ -230,7 +229,6 @@
 	}
 
 	c, err := initializeConfig(true, &s.hugoBuilderCommon, s, cfgInit)
-	// TODO(bep) cli refactor
 	if err != nil {
 		return err
 	}
@@ -349,7 +347,6 @@
 	return mu, u.String(), endpoint, nil
 }
 
-// TODO(bep) cli refactor
 func (c *commandeer) serve(s *serverCmd) error {
 
 	isMultiHost := c.hugo.IsMultihost()