commands: fix "comment add" flags set on the wrong command

Michael Muré created

Change summary

commands/comment_add.go       |  6 +++---
commands/root.go              |  2 +-
doc/man/git-bug-comment-add.1 |  8 ++++++++
doc/man/git-bug-comment.1     |  8 --------
doc/man/git-bug.1             |  4 +++-
doc/md/git-bug.md             |  6 +++++-
doc/md/git-bug_comment.md     |  4 +---
doc/md/git-bug_comment_add.md |  4 +++-
misc/bash_completion/git-bug  | 12 ++++++------
9 files changed, 30 insertions(+), 24 deletions(-)

Detailed changes

commands/comment_add.go 🔗

@@ -62,13 +62,13 @@ var commentAddCmd = &cobra.Command{
 func init() {
 	commentCmd.AddCommand(commentAddCmd)
 
-	commentCmd.Flags().SortFlags = false
+	commentAddCmd.Flags().SortFlags = false
 
-	commentCmd.Flags().StringVarP(&commentAddMessageFile, "file", "F", "",
+	commentAddCmd.Flags().StringVarP(&commentAddMessageFile, "file", "F", "",
 		"Take the message from the given file. Use - to read the message from the standard input",
 	)
 
-	commentCmd.Flags().StringVarP(&commentAddMessage, "message", "m", "",
+	commentAddCmd.Flags().StringVarP(&commentAddMessage, "message", "m", "",
 		"Provide the new message from the command line",
 	)
 }

commands/root.go 🔗

@@ -23,7 +23,7 @@ var RootCmd = &cobra.Command{
 	Short: "A bug tracker embedded in Git",
 	Long: `git-bug is a bug tracker embedded in git.
 
-git-hub use git objects to store the bug tracking separated from the files
+git-bug use git objects to store the bug tracking separated from the files
 history. As bugs are regular git objects, they can be pushed and pulled from/to
 the same git remote your are already using to collaborate with other peoples.
 

doc/man/git-bug-comment-add.1 🔗

@@ -19,6 +19,14 @@ Add a new comment
 
 
 .SH OPTIONS
+.PP
+\fB\-F\fP, \fB\-\-file\fP=""
+    Take the message from the given file. Use \- to read the message from the standard input
+
+.PP
+\fB\-m\fP, \fB\-\-message\fP=""
+    Provide the new message from the command line
+
 .PP
 \fB\-h\fP, \fB\-\-help\fP[=false]
     help for add

doc/man/git-bug-comment.1 🔗

@@ -19,14 +19,6 @@ Display or add comments
 
 
 .SH OPTIONS
-.PP
-\fB\-F\fP, \fB\-\-file\fP=""
-    Take the message from the given file. Use \- to read the message from the standard input
-
-.PP
-\fB\-m\fP, \fB\-\-message\fP=""
-    Provide the new message from the command line
-
 .PP
 \fB\-h\fP, \fB\-\-help\fP[=false]
     help for comment

doc/man/git-bug.1 🔗

@@ -18,7 +18,9 @@ git\-bug \- A bug tracker embedded in Git
 git\-bug is a bug tracker embedded in git.
 
 .PP
-It use the same internal storage so it doesn't pollute your project. As you would do with commits and branches, you can push your bugs to the same git remote your are already using to collaborate with other peoples.
+git\-bug use git objects to store the bug tracking separated from the files
+history. As bugs are regular git objects, they can be pushed and pulled from/to
+the same git remote your are already using to collaborate with other peoples.
 
 
 .SH OPTIONS

doc/md/git-bug.md 🔗

@@ -6,7 +6,11 @@ A bug tracker embedded in Git
 
 git-bug is a bug tracker embedded in git.
 
-It use the same internal storage so it doesn't pollute your project. As you would do with commits and branches, you can push your bugs to the same git remote your are already using to collaborate with other peoples.
+git-bug use git objects to store the bug tracking separated from the files
+history. As bugs are regular git objects, they can be pushed and pulled from/to
+the same git remote your are already using to collaborate with other peoples.
+
+
 
 ```
 git-bug [flags]

doc/md/git-bug_comment.md 🔗

@@ -13,9 +13,7 @@ git-bug comment [<id>] [flags]
 ### Options
 
 ```
-  -F, --file string      Take the message from the given file. Use - to read the message from the standard input
-  -m, --message string   Provide the new message from the command line
-  -h, --help             help for comment
+  -h, --help   help for comment
 ```
 
 ### SEE ALSO

doc/md/git-bug_comment_add.md 🔗

@@ -13,7 +13,9 @@ git-bug comment add [<id>] [flags]
 ### Options
 
 ```
-  -h, --help   help for add
+  -F, --file string      Take the message from the given file. Use - to read the message from the standard input
+  -m, --message string   Provide the new message from the command line
+  -h, --help             help for add
 ```
 
 ### SEE ALSO

misc/bash_completion/git-bug 🔗

@@ -397,6 +397,12 @@ _git-bug_comment_add()
     flags_with_completion=()
     flags_completion=()
 
+    flags+=("--file=")
+    two_word_flags+=("-F")
+    local_nonpersistent_flags+=("--file=")
+    flags+=("--message=")
+    two_word_flags+=("-m")
+    local_nonpersistent_flags+=("--message=")
 
     must_have_one_flag=()
     must_have_one_noun=()
@@ -418,12 +424,6 @@ _git-bug_comment()
     flags_with_completion=()
     flags_completion=()
 
-    flags+=("--file=")
-    two_word_flags+=("-F")
-    local_nonpersistent_flags+=("--file=")
-    flags+=("--message=")
-    two_word_flags+=("-m")
-    local_nonpersistent_flags+=("--message=")
 
     must_have_one_flag=()
     must_have_one_noun=()