diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-20 15:46:14 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-20 15:46:14 +0200 |
commit | e89f87624f27b7b98efc959bd96e260ac86f9236 (patch) | |
tree | 6561a1c1eb1660736c48d668f43ccaf67cce19a2 /commands | |
parent | 1dd5118eebe0e993d55ae5433cb2dcfd2764bf4f (diff) | |
download | git-bug-e89f87624f27b7b98efc959bd96e260ac86f9236.tar.gz |
generate markdown documentation
Diffstat (limited to 'commands')
-rw-r--r-- | commands/close.go | 2 | ||||
-rw-r--r-- | commands/commands.go | 2 | ||||
-rw-r--r-- | commands/comment.go | 2 | ||||
-rw-r--r-- | commands/label.go | 2 | ||||
-rw-r--r-- | commands/ls.go | 2 | ||||
-rw-r--r-- | commands/new.go | 2 | ||||
-rw-r--r-- | commands/open.go | 2 | ||||
-rw-r--r-- | commands/pull.go | 2 | ||||
-rw-r--r-- | commands/push.go | 2 | ||||
-rw-r--r-- | commands/root.go | 13 | ||||
-rw-r--r-- | commands/show.go | 2 | ||||
-rw-r--r-- | commands/webui.go | 2 |
12 files changed, 17 insertions, 18 deletions
diff --git a/commands/close.go b/commands/close.go index 66c2b84d..be0ff6e4 100644 --- a/commands/close.go +++ b/commands/close.go @@ -44,5 +44,5 @@ var closeCmd = &cobra.Command{ } func init() { - rootCmd.AddCommand(closeCmd) + RootCmd.AddCommand(closeCmd) } diff --git a/commands/commands.go b/commands/commands.go index f06d1ce8..0ab84717 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -47,7 +47,7 @@ var commandsCmd = &cobra.Command{ } func init() { - rootCmd.AddCommand(commandsCmd) + RootCmd.AddCommand(commandsCmd) commandsCmd.Flags().BoolVarP(&commandsDesc, "pretty", "p", false, "Output the command description as well as Markdown compatible comment", diff --git a/commands/comment.go b/commands/comment.go index ce40d2e3..cbd34ab3 100644 --- a/commands/comment.go +++ b/commands/comment.go @@ -65,7 +65,7 @@ var commentCmd = &cobra.Command{ } func init() { - rootCmd.AddCommand(commentCmd) + RootCmd.AddCommand(commentCmd) commentCmd.Flags().StringVarP(&commentMessageFile, "file", "F", "", "Take the message from the given file. Use - to read the message from the standard input", diff --git a/commands/label.go b/commands/label.go index 07dabfe8..08d7a78a 100644 --- a/commands/label.go +++ b/commands/label.go @@ -99,7 +99,7 @@ var labelCmd = &cobra.Command{ } func init() { - rootCmd.AddCommand(labelCmd) + RootCmd.AddCommand(labelCmd) labelCmd.Flags().BoolVarP(&labelRemove, "remove", "r", false, "Remove a label", diff --git a/commands/ls.go b/commands/ls.go index fe3f9288..1bc2afff 100644 --- a/commands/ls.go +++ b/commands/ls.go @@ -53,5 +53,5 @@ var lsCmd = &cobra.Command{ } func init() { - rootCmd.AddCommand(lsCmd) + RootCmd.AddCommand(lsCmd) } diff --git a/commands/new.go b/commands/new.go index 63bd885c..9844e121 100644 --- a/commands/new.go +++ b/commands/new.go @@ -65,7 +65,7 @@ var newCmd = &cobra.Command{ } func init() { - rootCmd.AddCommand(newCmd) + RootCmd.AddCommand(newCmd) newCmd.Flags().StringVarP(&newMessageFile, "file", "F", "", "Take the message from the given file. Use - to read the message from the standard input", diff --git a/commands/open.go b/commands/open.go index 83e20a4a..6fe1e9d3 100644 --- a/commands/open.go +++ b/commands/open.go @@ -44,5 +44,5 @@ var openCmd = &cobra.Command{ } func init() { - rootCmd.AddCommand(openCmd) + RootCmd.AddCommand(openCmd) } diff --git a/commands/pull.go b/commands/pull.go index 6e8acf50..83c2101a 100644 --- a/commands/pull.go +++ b/commands/pull.go @@ -89,5 +89,5 @@ var pullCmd = &cobra.Command{ } func init() { - rootCmd.AddCommand(pullCmd) + RootCmd.AddCommand(pullCmd) } diff --git a/commands/push.go b/commands/push.go index 5965e898..37479bfd 100644 --- a/commands/push.go +++ b/commands/push.go @@ -30,5 +30,5 @@ var pushCmd = &cobra.Command{ } func init() { - rootCmd.AddCommand(pushCmd) + RootCmd.AddCommand(pushCmd) } diff --git a/commands/root.go b/commands/root.go index 31aa6bad..74606018 100644 --- a/commands/root.go +++ b/commands/root.go @@ -10,14 +10,15 @@ import ( // Will display "git bug" // \u00A0 is a non-breaking space // It's used to avoid cobra to split the Use string at the first space to get the root command name -const rootCommandName = "git\u00A0bug" +//const rootCommandName = "git\u00A0bug" +const rootCommandName = "git-bug" const messageFilename = "BUG_MESSAGE_EDITMSG" // package scoped var to hold the repo after the PreRun execution var repo repository.Repo -// rootCmd represents the base command when called without any subcommands -var rootCmd = &cobra.Command{ +// RootCmd represents the base command when called without any subcommands +var RootCmd = &cobra.Command{ Use: rootCommandName, Short: "A bugtracker embedded in Git", Long: `git-bug is a bugtracker embedded in git. @@ -30,20 +31,18 @@ It use the same internal storage so it doesn't pollute your project. As you woul }, // Load the repo before any command execution - // Note, this concern only commands that actually has a Run function + // Note, this concern only commands that actually have a Run function PersistentPreRunE: loadRepo, } func Execute() { - if err := rootCmd.Execute(); err != nil { + if err := RootCmd.Execute(); err != nil { fmt.Println(err) os.Exit(1) } } func loadRepo(cmd *cobra.Command, args []string) error { - //fmt.Println("PersistentPreRun") - cwd, err := os.Getwd() if err != nil { return fmt.Errorf("Unable to get the current working directory: %q\n", err) diff --git a/commands/show.go b/commands/show.go index 8db3ed39..9d330aab 100644 --- a/commands/show.go +++ b/commands/show.go @@ -81,5 +81,5 @@ var showCmd = &cobra.Command{ } func init() { - rootCmd.AddCommand(showCmd) + RootCmd.AddCommand(showCmd) } diff --git a/commands/webui.go b/commands/webui.go index 0cabbc48..eef15d24 100644 --- a/commands/webui.go +++ b/commands/webui.go @@ -49,5 +49,5 @@ var webUICmd = &cobra.Command{ } func init() { - rootCmd.AddCommand(webUICmd) + RootCmd.AddCommand(webUICmd) } |