commands: cleanup the command's usage to avoid warnings when generating the doc

Michael Muré created

Change summary

commands/bridge_auth_addtoken.go        |  2 
commands/bridge_auth_rm.go              |  2 
commands/bridge_pull.go                 |  2 
commands/bridge_push.go                 |  2 
commands/bridge_rm.go                   |  2 
commands/commands.go                    |  2 
commands/comment.go                     |  4 +-
commands/comment_add.go                 |  4 +-
commands/label.go                       |  4 +-
commands/label_add.go                   |  8 ++++--
commands/label_rm.go                    |  8 ++++--
commands/ls-id.go                       |  2 
commands/ls.go                          |  2 
commands/pull.go                        |  2 
commands/push.go                        |  2 
commands/rm.go                          |  2 
commands/select.go                      |  6 ++--
commands/show.go                        | 12 +++++-----
commands/status.go                      |  5 +--
commands/status_close.go                |  5 +--
commands/status_open.go                 |  5 +--
commands/title.go                       |  5 +--
commands/title_edit.go                  |  4 +-
commands/user.go                        | 12 +++++-----
commands/user_adopt.go                  |  2 
doc/man/git-bug-bridge-auth-add-token.1 |  2 
doc/man/git-bug-bridge-auth-rm.1        |  2 
doc/man/git-bug-bridge-pull.1           |  2 
doc/man/git-bug-bridge-push.1           |  2 
doc/man/git-bug-bridge-rm.1             |  2 
doc/man/git-bug-commands.1              |  2 
doc/man/git-bug-comment-add.1           |  2 
doc/man/git-bug-comment.1               |  2 
doc/man/git-bug-label-add.1             |  2 
doc/man/git-bug-label-rm.1              |  2 
doc/man/git-bug-label.1                 |  2 
doc/man/git-bug-ls-id.1                 |  2 
doc/man/git-bug-ls.1                    |  2 
doc/man/git-bug-pull.1                  |  2 
doc/man/git-bug-push.1                  |  2 
doc/man/git-bug-rm.1                    | 28 +++++++++++++++++++++++++++
doc/man/git-bug-select.1                |  4 +-
doc/man/git-bug-show.1                  |  2 
doc/man/git-bug-status-close.1          |  2 
doc/man/git-bug-status-open.1           |  2 
doc/man/git-bug-status.1                |  2 
doc/man/git-bug-title-edit.1            |  2 
doc/man/git-bug-title.1                 |  2 
doc/man/git-bug-user-adopt.1            |  2 
doc/man/git-bug-user.1                  |  2 
doc/man/git-bug.1                       |  2 
doc/md/git-bug.md                       |  1 
doc/md/git-bug_bridge_auth_add-token.md |  2 
doc/md/git-bug_bridge_auth_rm.md        |  2 
doc/md/git-bug_bridge_pull.md           |  2 
doc/md/git-bug_bridge_push.md           |  2 
doc/md/git-bug_bridge_rm.md             |  2 
doc/md/git-bug_commands.md              |  2 
doc/md/git-bug_comment.md               |  2 
doc/md/git-bug_comment_add.md           |  2 
doc/md/git-bug_label.md                 |  2 
doc/md/git-bug_label_add.md             |  2 
doc/md/git-bug_label_rm.md              |  2 
doc/md/git-bug_ls-id.md                 |  2 
doc/md/git-bug_ls.md                    |  2 
doc/md/git-bug_pull.md                  |  2 
doc/md/git-bug_push.md                  |  2 
doc/md/git-bug_rm.md                    | 22 +++++++++++++++++++++
doc/md/git-bug_select.md                |  4 +-
doc/md/git-bug_show.md                  |  2 
doc/md/git-bug_status.md                |  2 
doc/md/git-bug_status_close.md          |  2 
doc/md/git-bug_status_open.md           |  2 
doc/md/git-bug_title.md                 |  2 
doc/md/git-bug_title_edit.md            |  2 
doc/md/git-bug_user.md                  |  2 
doc/md/git-bug_user_adopt.md            |  2 
misc/bash_completion/git-bug            | 21 ++++++++++++++++++++
misc/gen_completion.go                  | 26 ++++++++++++++----------
misc/powershell_completion/git-bug      |  4 +++
misc/zsh_completion/git-bug             |  8 +++++++
81 files changed, 203 insertions(+), 115 deletions(-)

Detailed changes

commands/bridge_auth_addtoken.go 🔗

@@ -27,7 +27,7 @@ func newBridgeAuthAddTokenCommand() *cobra.Command {
 	options := bridgeAuthAddTokenOptions{}
 
 	cmd := &cobra.Command{
-		Use:      "add-token [<token>]",
+		Use:      "add-token [TOKEN]",
 		Short:    "Store a new token",
 		PreRunE:  loadBackendEnsureUser(env),
 		PostRunE: closeBackend(env),

commands/bridge_auth_rm.go 🔗

@@ -10,7 +10,7 @@ func newBridgeAuthRm() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:     "rm <id>",
+		Use:     "rm ID",
 		Short:   "Remove a credential.",
 		PreRunE: loadRepo(env),
 		RunE: func(cmd *cobra.Command, args []string) error {

commands/bridge_pull.go 🔗

@@ -26,7 +26,7 @@ func newBridgePullCommand() *cobra.Command {
 	options := bridgePullOptions{}
 
 	cmd := &cobra.Command{
-		Use:      "pull [<name>]",
+		Use:      "pull [NAME]",
 		Short:    "Pull updates.",
 		PreRunE:  loadBackend(env),
 		PostRunE: closeBackend(env),

commands/bridge_push.go 🔗

@@ -17,7 +17,7 @@ func newBridgePushCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "push [<name>]",
+		Use:      "push [NAME]",
 		Short:    "Push updates.",
 		PreRunE:  loadBackendEnsureUser(env),
 		PostRunE: closeBackend(env),

commands/bridge_rm.go 🔗

@@ -10,7 +10,7 @@ func newBridgeRm() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "rm <name>",
+		Use:      "rm NAME",
 		Short:    "Delete a configured bridge.",
 		PreRunE:  loadBackend(env),
 		PostRunE: closeBackend(env),

commands/commands.go 🔗

@@ -15,7 +15,7 @@ func newCommandsCommand() *cobra.Command {
 	options := commandOptions{}
 
 	cmd := &cobra.Command{
-		Use:   "commands [<option>...]",
+		Use:   "commands",
 		Short: "Display available commands.",
 		RunE: func(cmd *cobra.Command, args []string) error {
 			return runCommands(env, options)

commands/comment.go 🔗

@@ -4,7 +4,7 @@ import (
 	text "github.com/MichaelMure/go-term-text"
 	"github.com/spf13/cobra"
 
-	"github.com/MichaelMure/git-bug/commands/select"
+	_select "github.com/MichaelMure/git-bug/commands/select"
 	"github.com/MichaelMure/git-bug/util/colors"
 )
 
@@ -12,7 +12,7 @@ func newCommentCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "comment [<id>]",
+		Use:      "comment [ID]",
 		Short:    "Display or add comments to a bug.",
 		PreRunE:  loadBackend(env),
 		PostRunE: closeBackend(env),

commands/comment_add.go 🔗

@@ -3,7 +3,7 @@ package commands
 import (
 	"github.com/spf13/cobra"
 
-	"github.com/MichaelMure/git-bug/commands/select"
+	_select "github.com/MichaelMure/git-bug/commands/select"
 	"github.com/MichaelMure/git-bug/input"
 )
 
@@ -17,7 +17,7 @@ func newCommentAddCommand() *cobra.Command {
 	options := commentAddOptions{}
 
 	cmd := &cobra.Command{
-		Use:      "add [<id>]",
+		Use:      "add [ID]",
 		Short:    "Add a new comment to a bug.",
 		PreRunE:  loadBackendEnsureUser(env),
 		PostRunE: closeBackend(env),

commands/label.go 🔗

@@ -3,14 +3,14 @@ package commands
 import (
 	"github.com/spf13/cobra"
 
-	"github.com/MichaelMure/git-bug/commands/select"
+	_select "github.com/MichaelMure/git-bug/commands/select"
 )
 
 func newLabelCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "label [<id>]",
+		Use:      "label [ID]",
 		Short:    "Display, add or remove labels to/from a bug.",
 		PreRunE:  loadBackend(env),
 		PostRunE: closeBackend(env),

commands/label_add.go 🔗

@@ -3,14 +3,14 @@ package commands
 import (
 	"github.com/spf13/cobra"
 
-	"github.com/MichaelMure/git-bug/commands/select"
+	_select "github.com/MichaelMure/git-bug/commands/select"
 )
 
 func newLabelAddCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "add [<id>] <label>[...]",
+		Use:      "add [ID] LABEL...",
 		Short:    "Add a label to a bug.",
 		PreRunE:  loadBackendEnsureUser(env),
 		PostRunE: closeBackend(env),
@@ -28,7 +28,9 @@ func runLabelAdd(env *Env, args []string) error {
 		return err
 	}
 
-	changes, _, err := b.ChangeLabels(args, nil)
+	added := args
+
+	changes, _, err := b.ChangeLabels(added, nil)
 
 	for _, change := range changes {
 		env.out.Println(change)

commands/label_rm.go 🔗

@@ -3,14 +3,14 @@ package commands
 import (
 	"github.com/spf13/cobra"
 
-	"github.com/MichaelMure/git-bug/commands/select"
+	_select "github.com/MichaelMure/git-bug/commands/select"
 )
 
 func newLabelRmCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "rm [<id>] <label>[...]",
+		Use:      "rm [ID] LABEL...",
 		Short:    "Remove a label from a bug.",
 		PreRunE:  loadBackend(env),
 		PostRunE: closeBackend(env),
@@ -28,7 +28,9 @@ func runLabelRm(env *Env, args []string) error {
 		return err
 	}
 
-	changes, _, err := b.ChangeLabels(nil, args)
+	removed := args
+
+	changes, _, err := b.ChangeLabels(nil, removed)
 
 	for _, change := range changes {
 		env.out.Println(change)

commands/ls-id.go 🔗

@@ -8,7 +8,7 @@ func newLsIdCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "ls-id [<prefix>]",
+		Use:      "ls-id [PREFIX]",
 		Short:    "List bug identifiers.",
 		PreRunE:  loadBackend(env),
 		PostRunE: closeBackend(env),

commands/ls.go 🔗

@@ -31,7 +31,7 @@ func newLsCommand() *cobra.Command {
 	options := lsOptions{}
 
 	cmd := &cobra.Command{
-		Use:   "ls [<query>]",
+		Use:   "ls [QUERY]",
 		Short: "List bugs.",
 		Long: `Display a summary of each bugs.
 

commands/pull.go 🔗

@@ -12,7 +12,7 @@ func newPullCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "pull [<remote>]",
+		Use:      "pull [REMOTE]",
 		Short:    "Pull bugs update from a git remote.",
 		PreRunE:  loadBackend(env),
 		PostRunE: closeBackend(env),

commands/push.go 🔗

@@ -10,7 +10,7 @@ func newPushCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "push [<remote>]",
+		Use:      "push [REMOTE]",
 		Short:    "Push bugs update to a git remote.",
 		PreRunE:  loadBackend(env),
 		PostRunE: closeBackend(env),

commands/rm.go 🔗

@@ -10,7 +10,7 @@ func newRmCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "rm <id>",
+		Use:      "rm ID",
 		Short:    "Remove an existing bug.",
 		Long:     "Remove an existing bug in the local repository. Note removing bugs that were imported from bridges will not remove the bug on the remote, and will only remove the local copy of the bug.",
 		PreRunE:  loadBackendEnsureUser(env),

commands/select.go 🔗

@@ -5,14 +5,14 @@ import (
 
 	"github.com/spf13/cobra"
 
-	"github.com/MichaelMure/git-bug/commands/select"
+	_select "github.com/MichaelMure/git-bug/commands/select"
 )
 
 func newSelectCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:   "select <id>",
+		Use:   "select ID",
 		Short: "Select a bug for implicit use in future commands.",
 		Example: `git bug select 2f15
 git bug comment
@@ -20,7 +20,7 @@ git bug status
 `,
 		Long: `Select a bug for implicit use in future commands.
 
-This command allows you to omit any bug <id> argument, for example:
+This command allows you to omit any bug ID argument, for example:
   git bug show
 instead of
   git bug show 2f153ca

commands/show.go 🔗

@@ -14,7 +14,7 @@ import (
 )
 
 type showOptions struct {
-	query  string
+	fields string
 	format string
 }
 
@@ -23,7 +23,7 @@ func newShowCommand() *cobra.Command {
 	options := showOptions{}
 
 	cmd := &cobra.Command{
-		Use:      "show [<id>]",
+		Use:      "show [ID]",
 		Short:    "Display the details of a bug.",
 		PreRunE:  loadBackend(env),
 		PostRunE: closeBackend(env),
@@ -35,7 +35,7 @@ func newShowCommand() *cobra.Command {
 	flags := cmd.Flags()
 	flags.SortFlags = false
 
-	flags.StringVarP(&options.query, "field", "", "",
+	flags.StringVarP(&options.fields, "field", "", "",
 		"Select field to display. Valid values are [author,authorEmail,createTime,lastEdit,humanId,id,labels,shortId,status,title,actors,participants]")
 	flags.StringVarP(&options.format, "format", "f", "default",
 		"Select the output formatting style. Valid values are [default,json,org-mode]")
@@ -55,8 +55,8 @@ func runShow(env *Env, opts showOptions, args []string) error {
 		return errors.New("invalid bug: no comment")
 	}
 
-	if opts.query != "" {
-		switch opts.query {
+	if opts.fields != "" {
+		switch opts.fields {
 		case "author":
 			env.out.Printf("%s\n", snap.Author.DisplayName())
 		case "authorEmail":
@@ -88,7 +88,7 @@ func runShow(env *Env, opts showOptions, args []string) error {
 		case "title":
 			env.out.Printf("%s\n", snap.Title)
 		default:
-			return fmt.Errorf("\nUnsupported field: %s\n", opts.query)
+			return fmt.Errorf("\nUnsupported field: %s\n", opts.fields)
 		}
 
 		return nil

commands/status.go 🔗

@@ -1,16 +1,15 @@
 package commands
 
 import (
+	_select "github.com/MichaelMure/git-bug/commands/select"
 	"github.com/spf13/cobra"
-
-	"github.com/MichaelMure/git-bug/commands/select"
 )
 
 func newStatusCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "status [<id>]",
+		Use:      "status [ID]",
 		Short:    "Display or change a bug status.",
 		PreRunE:  loadBackend(env),
 		PostRunE: closeBackend(env),

commands/status_close.go 🔗

@@ -1,16 +1,15 @@
 package commands
 
 import (
+	_select "github.com/MichaelMure/git-bug/commands/select"
 	"github.com/spf13/cobra"
-
-	"github.com/MichaelMure/git-bug/commands/select"
 )
 
 func newStatusCloseCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "close [<id>]",
+		Use:      "close [ID]",
 		Short:    "Mark a bug as closed.",
 		PreRunE:  loadBackendEnsureUser(env),
 		PostRunE: closeBackend(env),

commands/status_open.go 🔗

@@ -1,16 +1,15 @@
 package commands
 
 import (
+	_select "github.com/MichaelMure/git-bug/commands/select"
 	"github.com/spf13/cobra"
-
-	"github.com/MichaelMure/git-bug/commands/select"
 )
 
 func newStatusOpenCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "open [<id>]",
+		Use:      "open [ID]",
 		Short:    "Mark a bug as open.",
 		PreRunE:  loadBackendEnsureUser(env),
 		PostRunE: closeBackend(env),

commands/title.go 🔗

@@ -1,16 +1,15 @@
 package commands
 
 import (
+	_select "github.com/MichaelMure/git-bug/commands/select"
 	"github.com/spf13/cobra"
-
-	"github.com/MichaelMure/git-bug/commands/select"
 )
 
 func newTitleCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "title [<id>]",
+		Use:      "title [ID]",
 		Short:    "Display or change a title of a bug.",
 		PreRunE:  loadBackend(env),
 		PostRunE: closeBackend(env),

commands/title_edit.go 🔗

@@ -3,7 +3,7 @@ package commands
 import (
 	"github.com/spf13/cobra"
 
-	"github.com/MichaelMure/git-bug/commands/select"
+	_select "github.com/MichaelMure/git-bug/commands/select"
 	"github.com/MichaelMure/git-bug/input"
 )
 
@@ -16,7 +16,7 @@ func newTitleEditCommand() *cobra.Command {
 	options := titleEditOptions{}
 
 	cmd := &cobra.Command{
-		Use:      "edit [<id>]",
+		Use:      "edit [ID]",
 		Short:    "Edit a title of a bug.",
 		PreRunE:  loadBackendEnsureUser(env),
 		PostRunE: closeBackend(env),

commands/user.go 🔗

@@ -10,7 +10,7 @@ import (
 )
 
 type userOptions struct {
-	fieldsQuery string
+	fields string
 }
 
 func newUserCommand() *cobra.Command {
@@ -18,7 +18,7 @@ func newUserCommand() *cobra.Command {
 	options := userOptions{}
 
 	cmd := &cobra.Command{
-		Use:      "user [<user-id>]",
+		Use:      "user [USER-ID]",
 		Short:    "Display or change the user identity.",
 		PreRunE:  loadBackendEnsureUser(env),
 		PostRunE: closeBackend(env),
@@ -34,7 +34,7 @@ func newUserCommand() *cobra.Command {
 	flags := cmd.Flags()
 	flags.SortFlags = false
 
-	flags.StringVarP(&options.fieldsQuery, "field", "f", "",
+	flags.StringVarP(&options.fields, "field", "f", "",
 		"Select field to display. Valid values are [email,humanId,id,lastModification,lastModificationLamport,login,metadata,name]")
 
 	return cmd
@@ -57,8 +57,8 @@ func runUser(env *Env, opts userOptions, args []string) error {
 		return err
 	}
 
-	if opts.fieldsQuery != "" {
-		switch opts.fieldsQuery {
+	if opts.fields != "" {
+		switch opts.fields {
 		case "email":
 			env.out.Printf("%s\n", id.Email())
 		case "login":
@@ -80,7 +80,7 @@ func runUser(env *Env, opts userOptions, args []string) error {
 			env.out.Printf("%s\n", id.Name())
 
 		default:
-			return fmt.Errorf("\nUnsupported field: %s\n", opts.fieldsQuery)
+			return fmt.Errorf("\nUnsupported field: %s\n", opts.fields)
 		}
 
 		return nil

commands/user_adopt.go 🔗

@@ -8,7 +8,7 @@ func newUserAdoptCommand() *cobra.Command {
 	env := newEnv()
 
 	cmd := &cobra.Command{
-		Use:      "adopt <user-id>",
+		Use:      "adopt USER-ID",
 		Short:    "Adopt an existing identity as your own.",
 		Args:     cobra.ExactArgs(1),
 		PreRunE:  loadBackend(env),

doc/man/git-bug-bridge-auth-add-token.1 🔗

@@ -9,7 +9,7 @@ git\-bug\-bridge\-auth\-add\-token \- Store a new token
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug bridge auth add\-token [] [flags]\fP
+\fBgit\-bug bridge auth add\-token [TOKEN] [flags]\fP
 
 
 .SH DESCRIPTION

doc/man/git-bug-bridge-auth-rm.1 🔗

@@ -9,7 +9,7 @@ git\-bug\-bridge\-auth\-rm \- Remove a credential.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug bridge auth rm  [flags]\fP
+\fBgit\-bug bridge auth rm ID [flags]\fP
 
 
 .SH DESCRIPTION

doc/man/git-bug-bridge-pull.1 🔗

@@ -9,7 +9,7 @@ git\-bug\-bridge\-pull \- Pull updates.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug bridge pull [] [flags]\fP
+\fBgit\-bug bridge pull [NAME] [flags]\fP
 
 
 .SH DESCRIPTION

doc/man/git-bug-bridge-push.1 🔗

@@ -9,7 +9,7 @@ git\-bug\-bridge\-push \- Push updates.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug bridge push [] [flags]\fP
+\fBgit\-bug bridge push [NAME] [flags]\fP
 
 
 .SH DESCRIPTION

doc/man/git-bug-bridge-rm.1 🔗

@@ -9,7 +9,7 @@ git\-bug\-bridge\-rm \- Delete a configured bridge.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug bridge rm  [flags]\fP
+\fBgit\-bug bridge rm NAME [flags]\fP
 
 
 .SH DESCRIPTION

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

@@ -9,7 +9,7 @@ git\-bug\-commands \- Display available commands.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug commands [\&...] [flags]\fP
+\fBgit\-bug commands [flags]\fP
 
 
 .SH DESCRIPTION

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

@@ -9,7 +9,7 @@ git\-bug\-comment\-add \- Add a new comment to a bug.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug comment add [] [flags]\fP
+\fBgit\-bug comment add [ID] [flags]\fP
 
 
 .SH DESCRIPTION

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

@@ -9,7 +9,7 @@ git\-bug\-comment \- Display or add comments to a bug.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug comment [] [flags]\fP
+\fBgit\-bug comment [ID] [flags]\fP
 
 
 .SH DESCRIPTION

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

@@ -9,7 +9,7 @@ git\-bug\-label\-add \- Add a label to a bug.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug label add [] [...] [flags]\fP
+\fBgit\-bug label add [ID] LABEL... [flags]\fP
 
 
 .SH DESCRIPTION

doc/man/git-bug-label-rm.1 🔗

@@ -9,7 +9,7 @@ git\-bug\-label\-rm \- Remove a label from a bug.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug label rm [] [...] [flags]\fP
+\fBgit\-bug label rm [ID] LABEL... [flags]\fP
 
 
 .SH DESCRIPTION

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

@@ -9,7 +9,7 @@ git\-bug\-label \- Display, add or remove labels to/from a bug.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug label [] [flags]\fP
+\fBgit\-bug label [ID] [flags]\fP
 
 
 .SH DESCRIPTION

doc/man/git-bug-ls-id.1 🔗

@@ -9,7 +9,7 @@ git\-bug\-ls\-id \- List bug identifiers.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug ls\-id [] [flags]\fP
+\fBgit\-bug ls\-id [PREFIX] [flags]\fP
 
 
 .SH DESCRIPTION

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

@@ -9,7 +9,7 @@ git\-bug\-ls \- List bugs.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug ls [] [flags]\fP
+\fBgit\-bug ls [QUERY] [flags]\fP
 
 
 .SH DESCRIPTION

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

@@ -9,7 +9,7 @@ git\-bug\-pull \- Pull bugs update from a git remote.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug pull [] [flags]\fP
+\fBgit\-bug pull [REMOTE] [flags]\fP
 
 
 .SH DESCRIPTION

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

@@ -9,7 +9,7 @@ git\-bug\-push \- Push bugs update to a git remote.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug push [] [flags]\fP
+\fBgit\-bug push [REMOTE] [flags]\fP
 
 
 .SH DESCRIPTION

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

@@ -0,0 +1,28 @@
+.nh
+.TH GIT\-BUG(1)Apr 2019
+Generated from git\-bug's source code
+
+.SH NAME
+.PP
+git\-bug\-rm \- Remove an existing bug.
+
+
+.SH SYNOPSIS
+.PP
+\fBgit\-bug rm ID [flags]\fP
+
+
+.SH DESCRIPTION
+.PP
+Remove an existing bug in the local repository. Note removing bugs that were imported from bridges will not remove the bug on the remote, and will only remove the local copy of the bug.
+
+
+.SH OPTIONS
+.PP
+\fB\-h\fP, \fB\-\-help\fP[=false]
+	help for rm
+
+
+.SH SEE ALSO
+.PP
+\fBgit\-bug(1)\fP

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

@@ -9,7 +9,7 @@ git\-bug\-select \- Select a bug for implicit use in future commands.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug select  [flags]\fP
+\fBgit\-bug select ID [flags]\fP
 
 
 .SH DESCRIPTION
@@ -17,7 +17,7 @@ git\-bug\-select \- Select a bug for implicit use in future commands.
 Select a bug for implicit use in future commands.
 
 .PP
-This command allows you to omit any bug  argument, for example:
+This command allows you to omit any bug ID argument, for example:
   git bug show
 instead of
   git bug show 2f153ca

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

@@ -9,7 +9,7 @@ git\-bug\-show \- Display the details of a bug.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug show [] [flags]\fP
+\fBgit\-bug show [ID] [flags]\fP
 
 
 .SH DESCRIPTION

doc/man/git-bug-status-close.1 🔗

@@ -9,7 +9,7 @@ git\-bug\-status\-close \- Mark a bug as closed.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug status close [] [flags]\fP
+\fBgit\-bug status close [ID] [flags]\fP
 
 
 .SH DESCRIPTION

doc/man/git-bug-status-open.1 🔗

@@ -9,7 +9,7 @@ git\-bug\-status\-open \- Mark a bug as open.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug status open [] [flags]\fP
+\fBgit\-bug status open [ID] [flags]\fP
 
 
 .SH DESCRIPTION

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

@@ -9,7 +9,7 @@ git\-bug\-status \- Display or change a bug status.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug status [] [flags]\fP
+\fBgit\-bug status [ID] [flags]\fP
 
 
 .SH DESCRIPTION

doc/man/git-bug-title-edit.1 🔗

@@ -9,7 +9,7 @@ git\-bug\-title\-edit \- Edit a title of a bug.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug title edit [] [flags]\fP
+\fBgit\-bug title edit [ID] [flags]\fP
 
 
 .SH DESCRIPTION

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

@@ -9,7 +9,7 @@ git\-bug\-title \- Display or change a title of a bug.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug title [] [flags]\fP
+\fBgit\-bug title [ID] [flags]\fP
 
 
 .SH DESCRIPTION

doc/man/git-bug-user-adopt.1 🔗

@@ -9,7 +9,7 @@ git\-bug\-user\-adopt \- Adopt an existing identity as your own.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug user adopt  [flags]\fP
+\fBgit\-bug user adopt USER\-ID [flags]\fP
 
 
 .SH DESCRIPTION

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

@@ -9,7 +9,7 @@ git\-bug\-user \- Display or change the user identity.
 
 .SH SYNOPSIS
 .PP
-\fBgit\-bug user [] [flags]\fP
+\fBgit\-bug user [USER\-ID] [flags]\fP
 
 
 .SH DESCRIPTION

doc/man/git-bug.1 🔗

@@ -30,4 +30,4 @@ the same git remote you are already using to collaborate with other people.
 
 .SH SEE ALSO
 .PP
-\fBgit\-bug\-add(1)\fP, \fBgit\-bug\-bridge(1)\fP, \fBgit\-bug\-commands(1)\fP, \fBgit\-bug\-comment(1)\fP, \fBgit\-bug\-deselect(1)\fP, \fBgit\-bug\-label(1)\fP, \fBgit\-bug\-ls(1)\fP, \fBgit\-bug\-ls\-id(1)\fP, \fBgit\-bug\-ls\-label(1)\fP, \fBgit\-bug\-pull(1)\fP, \fBgit\-bug\-push(1)\fP, \fBgit\-bug\-select(1)\fP, \fBgit\-bug\-show(1)\fP, \fBgit\-bug\-status(1)\fP, \fBgit\-bug\-termui(1)\fP, \fBgit\-bug\-title(1)\fP, \fBgit\-bug\-user(1)\fP, \fBgit\-bug\-version(1)\fP, \fBgit\-bug\-webui(1)\fP
+\fBgit\-bug\-add(1)\fP, \fBgit\-bug\-bridge(1)\fP, \fBgit\-bug\-commands(1)\fP, \fBgit\-bug\-comment(1)\fP, \fBgit\-bug\-deselect(1)\fP, \fBgit\-bug\-label(1)\fP, \fBgit\-bug\-ls(1)\fP, \fBgit\-bug\-ls\-id(1)\fP, \fBgit\-bug\-ls\-label(1)\fP, \fBgit\-bug\-pull(1)\fP, \fBgit\-bug\-push(1)\fP, \fBgit\-bug\-rm(1)\fP, \fBgit\-bug\-select(1)\fP, \fBgit\-bug\-show(1)\fP, \fBgit\-bug\-status(1)\fP, \fBgit\-bug\-termui(1)\fP, \fBgit\-bug\-title(1)\fP, \fBgit\-bug\-user(1)\fP, \fBgit\-bug\-version(1)\fP, \fBgit\-bug\-webui(1)\fP

doc/md/git-bug.md 🔗

@@ -35,6 +35,7 @@ git-bug [flags]
 * [git-bug ls-label](git-bug_ls-label.md)	 - List valid labels.
 * [git-bug pull](git-bug_pull.md)	 - Pull bugs update from a git remote.
 * [git-bug push](git-bug_push.md)	 - Push bugs update to a git remote.
+* [git-bug rm](git-bug_rm.md)	 - Remove an existing bug.
 * [git-bug select](git-bug_select.md)	 - Select a bug for implicit use in future commands.
 * [git-bug show](git-bug_show.md)	 - Display the details of a bug.
 * [git-bug status](git-bug_status.md)	 - Display or change a bug status.

doc/md/git-bug_bridge_auth_rm.md 🔗

@@ -7,7 +7,7 @@ Remove a credential.
 Remove a credential.
 
 ```
-git-bug bridge auth rm <id> [flags]
+git-bug bridge auth rm ID [flags]
 ```
 
 ### Options

doc/md/git-bug_bridge_pull.md 🔗

@@ -7,7 +7,7 @@ Pull updates.
 Pull updates.
 
 ```
-git-bug bridge pull [<name>] [flags]
+git-bug bridge pull [NAME] [flags]
 ```
 
 ### Options

doc/md/git-bug_bridge_push.md 🔗

@@ -7,7 +7,7 @@ Push updates.
 Push updates.
 
 ```
-git-bug bridge push [<name>] [flags]
+git-bug bridge push [NAME] [flags]
 ```
 
 ### Options

doc/md/git-bug_bridge_rm.md 🔗

@@ -7,7 +7,7 @@ Delete a configured bridge.
 Delete a configured bridge.
 
 ```
-git-bug bridge rm <name> [flags]
+git-bug bridge rm NAME [flags]
 ```
 
 ### Options

doc/md/git-bug_commands.md 🔗

@@ -7,7 +7,7 @@ Display available commands.
 Display available commands.
 
 ```
-git-bug commands [<option>...] [flags]
+git-bug commands [flags]
 ```
 
 ### Options

doc/md/git-bug_comment.md 🔗

@@ -7,7 +7,7 @@ Display or add comments to a bug.
 Display or add comments to a bug.
 
 ```
-git-bug comment [<id>] [flags]
+git-bug comment [ID] [flags]
 ```
 
 ### Options

doc/md/git-bug_comment_add.md 🔗

@@ -7,7 +7,7 @@ Add a new comment to a bug.
 Add a new comment to a bug.
 
 ```
-git-bug comment add [<id>] [flags]
+git-bug comment add [ID] [flags]
 ```
 
 ### Options

doc/md/git-bug_label.md 🔗

@@ -7,7 +7,7 @@ Display, add or remove labels to/from a bug.
 Display, add or remove labels to/from a bug.
 
 ```
-git-bug label [<id>] [flags]
+git-bug label [ID] [flags]
 ```
 
 ### Options

doc/md/git-bug_label_add.md 🔗

@@ -7,7 +7,7 @@ Add a label to a bug.
 Add a label to a bug.
 
 ```
-git-bug label add [<id>] <label>[...] [flags]
+git-bug label add [ID] LABEL... [flags]
 ```
 
 ### Options

doc/md/git-bug_label_rm.md 🔗

@@ -7,7 +7,7 @@ Remove a label from a bug.
 Remove a label from a bug.
 
 ```
-git-bug label rm [<id>] <label>[...] [flags]
+git-bug label rm [ID] LABEL... [flags]
 ```
 
 ### Options

doc/md/git-bug_ls-id.md 🔗

@@ -7,7 +7,7 @@ List bug identifiers.
 List bug identifiers.
 
 ```
-git-bug ls-id [<prefix>] [flags]
+git-bug ls-id [PREFIX] [flags]
 ```
 
 ### Options

doc/md/git-bug_ls.md 🔗

@@ -9,7 +9,7 @@ Display a summary of each bugs.
 You can pass an additional query to filter and order the list. This query can be expressed either with a simple query language or with flags.
 
 ```
-git-bug ls [<query>] [flags]
+git-bug ls [QUERY] [flags]
 ```
 
 ### Examples

doc/md/git-bug_pull.md 🔗

@@ -7,7 +7,7 @@ Pull bugs update from a git remote.
 Pull bugs update from a git remote.
 
 ```
-git-bug pull [<remote>] [flags]
+git-bug pull [REMOTE] [flags]
 ```
 
 ### Options

doc/md/git-bug_push.md 🔗

@@ -7,7 +7,7 @@ Push bugs update to a git remote.
 Push bugs update to a git remote.
 
 ```
-git-bug push [<remote>] [flags]
+git-bug push [REMOTE] [flags]
 ```
 
 ### Options

doc/md/git-bug_rm.md 🔗

@@ -0,0 +1,22 @@
+## git-bug rm
+
+Remove an existing bug.
+
+### Synopsis
+
+Remove an existing bug in the local repository. Note removing bugs that were imported from bridges will not remove the bug on the remote, and will only remove the local copy of the bug.
+
+```
+git-bug rm ID [flags]
+```
+
+### Options
+
+```
+  -h, --help   help for rm
+```
+
+### SEE ALSO
+
+* [git-bug](git-bug.md)	 - A bug tracker embedded in Git.
+

doc/md/git-bug_select.md 🔗

@@ -6,7 +6,7 @@ Select a bug for implicit use in future commands.
 
 Select a bug for implicit use in future commands.
 
-This command allows you to omit any bug <id> argument, for example:
+This command allows you to omit any bug ID argument, for example:
   git bug show
 instead of
   git bug show 2f153ca
@@ -15,7 +15,7 @@ The complementary command is "git bug deselect" performing the opposite operatio
 
 
 ```
-git-bug select <id> [flags]
+git-bug select ID [flags]
 ```
 
 ### Examples

doc/md/git-bug_show.md 🔗

@@ -7,7 +7,7 @@ Display the details of a bug.
 Display the details of a bug.
 
 ```
-git-bug show [<id>] [flags]
+git-bug show [ID] [flags]
 ```
 
 ### Options

doc/md/git-bug_status.md 🔗

@@ -7,7 +7,7 @@ Display or change a bug status.
 Display or change a bug status.
 
 ```
-git-bug status [<id>] [flags]
+git-bug status [ID] [flags]
 ```
 
 ### Options

doc/md/git-bug_status_close.md 🔗

@@ -7,7 +7,7 @@ Mark a bug as closed.
 Mark a bug as closed.
 
 ```
-git-bug status close [<id>] [flags]
+git-bug status close [ID] [flags]
 ```
 
 ### Options

doc/md/git-bug_status_open.md 🔗

@@ -7,7 +7,7 @@ Mark a bug as open.
 Mark a bug as open.
 
 ```
-git-bug status open [<id>] [flags]
+git-bug status open [ID] [flags]
 ```
 
 ### Options

doc/md/git-bug_title.md 🔗

@@ -7,7 +7,7 @@ Display or change a title of a bug.
 Display or change a title of a bug.
 
 ```
-git-bug title [<id>] [flags]
+git-bug title [ID] [flags]
 ```
 
 ### Options

doc/md/git-bug_title_edit.md 🔗

@@ -7,7 +7,7 @@ Edit a title of a bug.
 Edit a title of a bug.
 
 ```
-git-bug title edit [<id>] [flags]
+git-bug title edit [ID] [flags]
 ```
 
 ### Options

doc/md/git-bug_user.md 🔗

@@ -7,7 +7,7 @@ Display or change the user identity.
 Display or change the user identity.
 
 ```
-git-bug user [<user-id>] [flags]
+git-bug user [USER-ID] [flags]
 ```
 
 ### Options

doc/md/git-bug_user_adopt.md 🔗

@@ -7,7 +7,7 @@ Adopt an existing identity as your own.
 Adopt an existing identity as your own.
 
 ```
-git-bug user adopt <user-id> [flags]
+git-bug user adopt USER-ID [flags]
 ```
 
 ### Options

misc/bash_completion/git-bug 🔗

@@ -897,6 +897,26 @@ _git-bug_push()
     noun_aliases=()
 }
 
+_git-bug_rm()
+{
+    last_command="git-bug_rm"
+
+    command_aliases=()
+
+    commands=()
+
+    flags=()
+    two_word_flags=()
+    local_nonpersistent_flags=()
+    flags_with_completion=()
+    flags_completion=()
+
+
+    must_have_one_flag=()
+    must_have_one_noun=()
+    noun_aliases=()
+}
+
 _git-bug_select()
 {
     last_command="git-bug_select"
@@ -1239,6 +1259,7 @@ _git-bug_root_command()
     commands+=("ls-label")
     commands+=("pull")
     commands+=("push")
+    commands+=("rm")
     commands+=("select")
     commands+=("show")
     commands+=("status")

misc/gen_completion.go 🔗

@@ -6,13 +6,17 @@ import (
 	"path"
 	"sync"
 
+	"github.com/spf13/cobra"
+
 	"github.com/MichaelMure/git-bug/commands"
 )
 
 func main() {
 	fmt.Println("Generating completion files ...")
 
-	tasks := map[string]func() error{
+	root := commands.NewRootCommand()
+
+	tasks := map[string]func(*cobra.Command) error{
 		"Bash":       genBash,
 		"Fish":       genFish,
 		"PowerShell": genPowerShell,
@@ -22,9 +26,9 @@ func main() {
 	var wg sync.WaitGroup
 	for name, f := range tasks {
 		wg.Add(1)
-		go func(name string, f func() error) {
+		go func(name string, f func(*cobra.Command) error) {
 			defer wg.Done()
-			err := f()
+			err := f(root)
 			if err != nil {
 				fmt.Printf("  - %s: %v\n", name, err)
 				return
@@ -36,26 +40,26 @@ func main() {
 	wg.Wait()
 }
 
-func genBash() error {
+func genBash(root *cobra.Command) error {
 	cwd, _ := os.Getwd()
 	dir := path.Join(cwd, "misc", "bash_completion", "git-bug")
-	return commands.NewRootCommand().GenBashCompletionFile(dir)
+	return root.GenBashCompletionFile(dir)
 }
 
-func genFish() error {
+func genFish(root *cobra.Command) error {
 	cwd, _ := os.Getwd()
 	dir := path.Join(cwd, "misc", "fish_completion", "git-bug")
-	return commands.NewRootCommand().GenFishCompletionFile(dir, true)
+	return root.GenFishCompletionFile(dir, true)
 }
 
-func genPowerShell() error {
+func genPowerShell(root *cobra.Command) error {
 	cwd, _ := os.Getwd()
 	filepath := path.Join(cwd, "misc", "powershell_completion", "git-bug")
-	return commands.NewRootCommand().GenPowerShellCompletionFile(filepath)
+	return root.GenPowerShellCompletionFile(filepath)
 }
 
-func genZsh() error {
+func genZsh(root *cobra.Command) error {
 	cwd, _ := os.Getwd()
 	filepath := path.Join(cwd, "misc", "zsh_completion", "git-bug")
-	return commands.NewRootCommand().GenZshCompletionFile(filepath)
+	return root.GenZshCompletionFile(filepath)
 }

misc/powershell_completion/git-bug 🔗

@@ -28,6 +28,7 @@ Register-ArgumentCompleter -Native -CommandName 'git-bug' -ScriptBlock {
             [CompletionResult]::new('ls-label', 'ls-label', [CompletionResultType]::ParameterValue, 'List valid labels.')
             [CompletionResult]::new('pull', 'pull', [CompletionResultType]::ParameterValue, 'Pull bugs update from a git remote.')
             [CompletionResult]::new('push', 'push', [CompletionResultType]::ParameterValue, 'Push bugs update to a git remote.')
+            [CompletionResult]::new('rm', 'rm', [CompletionResultType]::ParameterValue, 'Remove an existing bug.')
             [CompletionResult]::new('select', 'select', [CompletionResultType]::ParameterValue, 'Select a bug for implicit use in future commands.')
             [CompletionResult]::new('show', 'show', [CompletionResultType]::ParameterValue, 'Display the details of a bug.')
             [CompletionResult]::new('status', 'status', [CompletionResultType]::ParameterValue, 'Display or change a bug status.')
@@ -175,6 +176,9 @@ Register-ArgumentCompleter -Native -CommandName 'git-bug' -ScriptBlock {
         'git-bug;push' {
             break
         }
+        'git-bug;rm' {
+            break
+        }
         'git-bug;select' {
             break
         }

misc/zsh_completion/git-bug 🔗

@@ -22,6 +22,7 @@ function _git-bug {
       "ls-label:List valid labels."
       "pull:Pull bugs update from a git remote."
       "push:Push bugs update to a git remote."
+      "rm:Remove an existing bug."
       "select:Select a bug for implicit use in future commands."
       "show:Display the details of a bug."
       "status:Display or change a bug status."
@@ -69,6 +70,9 @@ function _git-bug {
   push)
     _git-bug_push
     ;;
+  rm)
+    _git-bug_rm
+    ;;
   select)
     _git-bug_select
     ;;
@@ -323,6 +327,10 @@ function _git-bug_push {
   _arguments
 }
 
+function _git-bug_rm {
+  _arguments
+}
+
 function _git-bug_select {
   _arguments
 }