hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 3d09de891072985e6c59f899f09132a76d44f7cd
parent 831e936846920b395dddd584b76e2b9f6b7c18a1
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Mon, 23 Nov 2015 16:51:12 +0100

Restructure the gen commands

Fixes #1603

Diffstat:
Acommands/gen.go | 10++++++++++
Mcommands/genautocomplete.go | 2+-
Mcommands/gendoc.go | 2+-
Mcommands/genman.go | 2+-
Mcommands/hugo.go | 9++++++---
5 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/commands/gen.go b/commands/gen.go
@@ -0,0 +1,10 @@
+package commands
+
+import (
+	"github.com/spf13/cobra"
+)
+
+var genCmd = &cobra.Command{
+	Use:   "gen",
+	Short: "A collection of several useful generators.",
+}
diff --git a/commands/genautocomplete.go b/commands/genautocomplete.go
@@ -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.
 
diff --git a/commands/gendoc.go b/commands/gendoc.go
@@ -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.
 
diff --git a/commands/genman.go b/commands/genman.go
@@ -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
diff --git a/commands/hugo.go b/commands/hugo.go
@@ -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