From 4d32f2fa8969f368b088dc9bcedb45f2c986cb27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 10 Apr 2018 09:19:26 +0200 Subject: commands: Make the hugo command non-global See #4598 --- commands/gendoc.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'commands/gendoc.go') 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.") -- cgit v1.2.3