commands: Make the hugo command non-global

See #4598
This commit is contained in:
Bjørn Erik Pedersen 2018-04-10 09:19:26 +02:00
parent 018602c46d
commit 4d32f2fa89
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
23 changed files with 299 additions and 336 deletions

View file

@ -26,16 +26,12 @@ import (
var _ cmder = (*versionCmd)(nil)
type versionCmd struct {
cmd *cobra.Command
}
func (c *versionCmd) getCommand() *cobra.Command {
return c.cmd
*baseCmd
}
func newVersionCmd() *versionCmd {
return &versionCmd{
&cobra.Command{
newBaseCmd(&cobra.Command{
Use: "version",
Short: "Print the version number of Hugo",
Long: `All software has versions. This is Hugo's.`,
@ -43,7 +39,7 @@ func newVersionCmd() *versionCmd {
printHugoVersion()
return nil
},
},
}),
}
}