Permalink
Browse files

commands: Remove some TODOs

See #4598
  • Loading branch information...
bep committed Apr 11, 2018
1 parent f396cff commit e7010c1b621d68ee53411a5ba8143d07b976d9fe
Showing with 0 additions and 37 deletions.
  1. +0 −11 commands/commands.go
  2. +0 −14 commands/hugo.go
  3. +0 −1 commands/list.go
  4. +0 −2 commands/new.go
  5. +0 −1 commands/new_content_test.go
  6. +0 −5 commands/release.go
  7. +0 −3 commands/server.go
View
@@ -75,22 +75,11 @@ func newBuilderCmd(cmd *cobra.Command) *baseBuilderCmd {
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
}
View
@@ -53,20 +53,6 @@ import (
// 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()
View
@@ -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().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{})
View
@@ -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")
// 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 @@ func touchFile(fs afero.Fs, x ...string) {
}
}
// TODO(bep) cli refactor => method
func newContentPathSection(path string) (string, string) {
// Forward slashes is used in all examples. Convert if needed.
// Issue #1133
@@ -48,7 +48,6 @@ func checkNewSiteInited(fs *hugofs.Fs, basepath string, t *testing.T) {
}
func TestDoNewSite(t *testing.T) {
// TODO(bep) cli refactor
n := newNewSiteCmd()
basepath := filepath.Join("base", "blog")
_, fs := newTestCfg()
View
@@ -22,11 +22,6 @@ import (
"github.com/spf13/cobra"
)
func init() {
// TODO(bep) cli refactor
//HugoCmd.AddCommand(createReleaser().cmd)
}
type releaseCommandeer struct {
cmd *cobra.Command
View
@@ -85,7 +85,6 @@ of a second, you will be able to save and see your changes nearly instantly.`,
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 @@ func (s *serverCmd) server(cmd *cobra.Command, args []string) error {
}
c, err := initializeConfig(true, &s.hugoBuilderCommon, s, cfgInit)
// TODO(bep) cli refactor
if err != nil {
return err
}
@@ -349,7 +347,6 @@ func (f *fileServer) createEndpoint(i int) (*http.ServeMux, string, string, erro
return mu, u.String(), endpoint, nil
}
// TODO(bep) cli refactor
func (c *commandeer) serve(s *serverCmd) error {
isMultiHost := c.hugo.IsMultihost()

0 comments on commit e7010c1

Please sign in to comment.