Restructure the gen commands

Fixes #1603
This commit is contained in:
Bjørn Erik Pedersen 2015-11-23 16:51:12 +01:00
parent 831e936846
commit 3d09de8910
5 changed files with 19 additions and 6 deletions

10
commands/gen.go Normal file
View file

@ -0,0 +1,10 @@
package commands
import (
"github.com/spf13/cobra"
)
var genCmd = &cobra.Command{
Use: "gen",
Short: "A collection of several useful generators.",
}

View file

@ -11,7 +11,7 @@ var autocompleteTarget string
var autocompleteType string
var genautocompleteCmd = &cobra.Command{
Use: "genautocomplete",
Use: "autocomplete",
Short: "Generate shell autocompletion script for Hugo",
Long: `Generates a shell autocompletion script for Hugo.

View file

@ -22,7 +22,7 @@ url: %s
var gendocdir string
var gendocCmd = &cobra.Command{
Use: "gendoc",
Use: "doc",
Short: "Generate Markdown documentation for the Hugo CLI.",
Long: `Generate Markdown documentation for the Hugo CLI.

View file

@ -9,7 +9,7 @@ import (
)
var genmanCmd = &cobra.Command{
Use: "genman",
Use: "man",
Short: "Generate man pages for the Hugo CLI",
Long: `This command automatically generates up-to-date man pages of Hugo's
command-line interface. By default, it creates the man page files

View file

@ -86,10 +86,13 @@ func AddCommands() {
HugoCmd.AddCommand(newCmd)
HugoCmd.AddCommand(listCmd)
HugoCmd.AddCommand(undraftCmd)
HugoCmd.AddCommand(genautocompleteCmd)
HugoCmd.AddCommand(gendocCmd)
HugoCmd.AddCommand(genmanCmd)
HugoCmd.AddCommand(importCmd)
HugoCmd.AddCommand(genCmd)
genCmd.AddCommand(genautocompleteCmd)
genCmd.AddCommand(gendocCmd)
genCmd.AddCommand(genmanCmd)
}
//Initializes flags