aboutsummaryrefslogtreecommitdiffstats
path: root/commands/root.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-20 15:46:14 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-20 15:46:14 +0200
commite89f87624f27b7b98efc959bd96e260ac86f9236 (patch)
tree6561a1c1eb1660736c48d668f43ccaf67cce19a2 /commands/root.go
parent1dd5118eebe0e993d55ae5433cb2dcfd2764bf4f (diff)
downloadgit-bug-e89f87624f27b7b98efc959bd96e260ac86f9236.tar.gz
generate markdown documentation
Diffstat (limited to 'commands/root.go')
-rw-r--r--commands/root.go13
1 files changed, 6 insertions, 7 deletions
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)