Skip to content

Commit

Permalink
commands: Fix some flag diff
Browse files Browse the repository at this point in the history
The CLI docs output is now identical with the master version.

See #4598
  • Loading branch information
bep committed Apr 11, 2018
1 parent a7d00fc commit 24d5c21
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions commands/benchmark.go
Expand Up @@ -44,6 +44,7 @@ creating a benchmark.`,
cmd.Flags().StringVar(&c.cpuProfileFile, "cpuprofile", "", "path/filename for the CPU profile file") cmd.Flags().StringVar(&c.cpuProfileFile, "cpuprofile", "", "path/filename for the CPU profile file")
cmd.Flags().StringVar(&c.memProfileFile, "memprofile", "", "path/filename for the memory profile file") cmd.Flags().StringVar(&c.memProfileFile, "memprofile", "", "path/filename for the memory profile file")
cmd.Flags().IntVarP(&c.benchmarkTimes, "count", "n", 13, "number of times to build the site") cmd.Flags().IntVarP(&c.benchmarkTimes, "count", "n", 13, "number of times to build the site")
cmd.Flags().Bool("renderToMemory", false, "render to memory (only useful for benchmark testing)")


cmd.RunE = c.benchmark cmd.RunE = c.benchmark


Expand Down
3 changes: 2 additions & 1 deletion commands/commands.go
Expand Up @@ -138,6 +138,8 @@ Complete documentation is available at http://gohugo.io/.`,


cc.cmd.Flags().BoolVarP(&cc.buildWatch, "watch", "w", false, "watch filesystem for changes and recreate as needed") cc.cmd.Flags().BoolVarP(&cc.buildWatch, "watch", "w", false, "watch filesystem for changes and recreate as needed")


cc.cmd.Flags().Bool("renderToMemory", false, "render to memory (only useful for benchmark testing)")

// Set bash-completion // Set bash-completion
_ = cc.cmd.PersistentFlags().SetAnnotation("logFile", cobra.BashCompFilenameExt, []string{}) _ = cc.cmd.PersistentFlags().SetAnnotation("logFile", cobra.BashCompFilenameExt, []string{})


Expand Down Expand Up @@ -194,7 +196,6 @@ func (cc *hugoBuilderCommon) handleFlags(cmd *cobra.Command) {
cmd.Flags().BoolP("noTimes", "", false, "don't sync modification time of files") cmd.Flags().BoolP("noTimes", "", false, "don't sync modification time of files")
cmd.Flags().BoolP("noChmod", "", false, "don't sync permission mode of files") cmd.Flags().BoolP("noChmod", "", false, "don't sync permission mode of files")
cmd.Flags().BoolP("i18n-warnings", "", false, "print missing translations") cmd.Flags().BoolP("i18n-warnings", "", false, "print missing translations")
cmd.Flags().Bool("renderToMemory", false, "render to memory (only useful for benchmark testing)")


cmd.Flags().StringSlice("disableKinds", []string{}, "disable different kind of pages (home, RSS etc.)") cmd.Flags().StringSlice("disableKinds", []string{}, "disable different kind of pages (home, RSS etc.)")


Expand Down
7 changes: 4 additions & 3 deletions commands/convert.go
Expand Up @@ -33,17 +33,18 @@ var (
) )


type convertCmd struct { type convertCmd struct {
hugoBuilderCommon

outputDir string outputDir string
unsafe bool unsafe bool


*baseBuilderCmd *baseCmd
} }


func newConvertCmd() *convertCmd { func newConvertCmd() *convertCmd {
cc := &convertCmd{} cc := &convertCmd{}


// TODO(bep) cli refactor this is more than it had cc.baseCmd = newBaseCmd(&cobra.Command{
cc.baseBuilderCmd = newBuilderCmd(&cobra.Command{
Use: "convert", Use: "convert",
Short: "Convert your content to different formats", Short: "Convert your content to different formats",
Long: `Convert your content (e.g. front matter) to different formats. Long: `Convert your content (e.g. front matter) to different formats.
Expand Down

0 comments on commit 24d5c21

Please sign in to comment.