ref: 3d09de891072985e6c59f899f09132a76d44f7cd
parent: 831e936846920b395dddd584b76e2b9f6b7c18a1
author: Bjørn Erik Pedersen <[email protected]>
date: Mon Nov 23 11:51:12 EST 2015
Restructure the gen commands Fixes #1603
--- /dev/null
+++ b/commands/gen.go
@@ -1,0 +1,10 @@
+package commands
+
+import (
+ "github.com/spf13/cobra"
+)
+
+var genCmd = &cobra.Command{
+ Use: "gen",
+ Short: "A collection of several useful generators.",
+}
--- a/commands/genautocomplete.go
+++ b/commands/genautocomplete.go
@@ -11,7 +11,7 @@
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.
--- a/commands/gendoc.go
+++ b/commands/gendoc.go
@@ -22,7 +22,7 @@
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.
--- a/commands/genman.go
+++ b/commands/genman.go
@@ -9,7 +9,7 @@
)
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
--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -86,10 +86,13 @@
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