commands: Remove some TODOs

See #4598
This commit is contained in:
Bjørn Erik Pedersen 2018-04-11 10:15:01 +02:00
parent f396cffa23
commit e7010c1b62
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
7 changed files with 0 additions and 37 deletions

View file

@ -75,22 +75,11 @@ func newBuilderCmd(cmd *cobra.Command) *baseBuilderCmd {
return bcmd return bcmd
} }
// TODO(bep) cli refactor need root?
func (c *baseCmd) flagsToConfig(cfg config.Provider) { func (c *baseCmd) flagsToConfig(cfg config.Provider) {
initializeFlags(c.cmd, cfg) initializeFlags(c.cmd, cfg)
} }
type hugoCmd struct { type hugoCmd struct {
//cacheDir string
//contentDir string
//layoutDir string
//destination string
//theme string
//themesDir string
//logI18nWarnings bool
//disableKinds []string
*baseBuilderCmd *baseBuilderCmd
} }

View file

@ -53,20 +53,6 @@ import (
// TODO(bep) cli refactor consider a exported Hugo() method to fix the API // 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. // Execute adds all child commands to the root command HugoCmd and sets flags appropriately.
func Execute() { func Execute() {
hugoCmd := newHugoCompleteCmd() hugoCmd := newHugoCompleteCmd()

View file

@ -150,7 +150,6 @@ expired.`,
}, },
) )
// TODO(bep) cli refactor
cc.cmd.PersistentFlags().StringVarP(&cc.source, "source", "s", "", "filesystem path to read files relative from") 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.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{})

View file

@ -53,7 +53,6 @@ If archetypes are provided in your theme or site, they will be used.`,
}) })
cc.cmd.Flags().StringVarP(&cc.contentType, "kind", "k", "", "content type to create") 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().StringVarP(&cc.source, "source", "s", "", "filesystem path to read files relative from")
cc.cmd.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{}) cc.cmd.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{})
cc.cmd.Flags().StringVar(&cc.contentEditor, "editor", "", "edit new content with this editor, if provided") cc.cmd.Flags().StringVar(&cc.contentEditor, "editor", "", "edit new content with this editor, if provided")
@ -169,7 +168,6 @@ func touchFile(fs afero.Fs, x ...string) {
} }
} }
// TODO(bep) cli refactor => method
func newContentPathSection(path string) (string, string) { func newContentPathSection(path string) (string, string) {
// Forward slashes is used in all examples. Convert if needed. // Forward slashes is used in all examples. Convert if needed.
// Issue #1133 // Issue #1133

View file

@ -48,7 +48,6 @@ func checkNewSiteInited(fs *hugofs.Fs, basepath string, t *testing.T) {
} }
func TestDoNewSite(t *testing.T) { func TestDoNewSite(t *testing.T) {
// TODO(bep) cli refactor
n := newNewSiteCmd() n := newNewSiteCmd()
basepath := filepath.Join("base", "blog") basepath := filepath.Join("base", "blog")
_, fs := newTestCfg() _, fs := newTestCfg()

View file

@ -22,11 +22,6 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
func init() {
// TODO(bep) cli refactor
//HugoCmd.AddCommand(createReleaser().cmd)
}
type releaseCommandeer struct { type releaseCommandeer struct {
cmd *cobra.Command cmd *cobra.Command

View file

@ -85,7 +85,6 @@ of a second, you will be able to save and see your changes nearly instantly.`,
RunE: cc.server, 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().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().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") cc.cmd.Flags().StringVarP(&cc.serverInterface, "bind", "", "127.0.0.1", "interface to which the server will bind")
@ -230,7 +229,6 @@ func (s *serverCmd) server(cmd *cobra.Command, args []string) error {
} }
c, err := initializeConfig(true, &s.hugoBuilderCommon, s, cfgInit) c, err := initializeConfig(true, &s.hugoBuilderCommon, s, cfgInit)
// TODO(bep) cli refactor
if err != nil { if err != nil {
return err return err
} }
@ -349,7 +347,6 @@ func (f *fileServer) createEndpoint(i int) (*http.ServeMux, string, string, erro
return mu, u.String(), endpoint, nil return mu, u.String(), endpoint, nil
} }
// TODO(bep) cli refactor
func (c *commandeer) serve(s *serverCmd) error { func (c *commandeer) serve(s *serverCmd) error {
isMultiHost := c.hugo.IsMultihost() isMultiHost := c.hugo.IsMultihost()