diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-04-10 09:19:26 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-04-11 09:50:19 +0200 |
commit | 4d32f2fa8969f368b088dc9bcedb45f2c986cb27 (patch) | |
tree | a091c49f6011605f08b92b9dbdb2d2acdd87f9ce /commands/gendoc.go | |
parent | 018602c46db8d729af2871bd5f4c1e7480420f09 (diff) |
commands: Make the hugo command non-global
See #4598
Diffstat (limited to 'commands/gendoc.go')
-rw-r--r-- | commands/gendoc.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/commands/gendoc.go b/commands/gendoc.go index 8c46fe98c..3446c2622 100644 --- a/commands/gendoc.go +++ b/commands/gendoc.go @@ -31,11 +31,7 @@ var _ cmder = (*genDocCmd)(nil) type genDocCmd struct { gendocdir string - cmd *cobra.Command -} - -func (c *genDocCmd) getCommand() *cobra.Command { - return c.cmd + *baseCmd } func newGenDocCmd() *genDocCmd { @@ -49,7 +45,7 @@ url: %s cc := &genDocCmd{} - cc.cmd = &cobra.Command{ + cc.baseCmd = newBaseCmd(&cobra.Command{ Use: "doc", Short: "Generate Markdown documentation for the Hugo CLI.", Long: `Generate Markdown documentation for the Hugo CLI. @@ -89,7 +85,7 @@ for rendering in Hugo.`, return nil }, - } + }) cc.cmd.PersistentFlags().StringVar(&cc.gendocdir, "dir", "/tmp/hugodoc/", "the directory to write the doc.") |