Merge pull request #436 from MichaelMure/cli-usage

commands: cleanup the command's usage to avoid warnings when generating the doc
This commit is contained in:
Michael Muré 2020-07-28 20:40:12 +02:00 committed by GitHub
commit a15ad8391f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
81 changed files with 203 additions and 115 deletions

View File

@ -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),

View File

@ -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 {

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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)

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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)

View File

@ -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)

View File

@ -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),

View File

@ -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.

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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

View File

@ -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

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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

View File

@ -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),

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

28
doc/man/git-bug-rm.1 Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -7,7 +7,7 @@ Store a new token
Store a new token
```
git-bug bridge auth add-token [<token>] [flags]
git-bug bridge auth add-token [TOKEN] [flags]
```
### Options

View File

@ -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

View File

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

View File

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

View File

@ -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

View File

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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

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

View File

@ -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

View File

@ -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

View File

@ -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

22
doc/md/git-bug_rm.md Normal file
View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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")

View File

@ -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)
}

View File

@ -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
}

View File

@ -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
}