mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
commands: migrate the open/close commands under the "status" command
This commit is contained in:
parent
a846fb96de
commit
dad61892ce
@ -7,7 +7,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func runCloseBug(cmd *cobra.Command, args []string) error {
|
||||
func runStatusClose(cmd *cobra.Command, args []string) error {
|
||||
if len(args) > 1 {
|
||||
return errors.New("Only closing one bug at a time is supported")
|
||||
}
|
||||
@ -40,9 +40,9 @@ func runCloseBug(cmd *cobra.Command, args []string) error {
|
||||
var closeCmd = &cobra.Command{
|
||||
Use: "close <id>",
|
||||
Short: "Mark the bug as closed",
|
||||
RunE: runCloseBug,
|
||||
RunE: runStatusClose,
|
||||
}
|
||||
|
||||
func init() {
|
||||
RootCmd.AddCommand(closeCmd)
|
||||
statusCmd.AddCommand(closeCmd)
|
||||
}
|
@ -7,7 +7,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func runOpenBug(cmd *cobra.Command, args []string) error {
|
||||
func runStatusOpen(cmd *cobra.Command, args []string) error {
|
||||
if len(args) > 1 {
|
||||
return errors.New("Only opening one bug at a time is supported")
|
||||
}
|
||||
@ -40,9 +40,9 @@ func runOpenBug(cmd *cobra.Command, args []string) error {
|
||||
var openCmd = &cobra.Command{
|
||||
Use: "open <id>",
|
||||
Short: "Mark the bug as open",
|
||||
RunE: runOpenBug,
|
||||
RunE: runStatusOpen,
|
||||
}
|
||||
|
||||
func init() {
|
||||
RootCmd.AddCommand(openCmd)
|
||||
statusCmd.AddCommand(openCmd)
|
||||
}
|
29
doc/man/git-bug-status-close.1
Normal file
29
doc/man/git-bug-status-close.1
Normal file
@ -0,0 +1,29 @@
|
||||
.TH "GIT-BUG" "1" "Sep 2018" "Generated from git-bug's source code" ""
|
||||
.nh
|
||||
.ad l
|
||||
|
||||
|
||||
.SH NAME
|
||||
.PP
|
||||
git\-bug\-status\-close \- Mark the bug as closed
|
||||
|
||||
|
||||
.SH SYNOPSIS
|
||||
.PP
|
||||
\fBgit\-bug status close <id> [flags]\fP
|
||||
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Mark the bug as closed
|
||||
|
||||
|
||||
.SH OPTIONS
|
||||
.PP
|
||||
\fB\-h\fP, \fB\-\-help\fP[=false]
|
||||
help for close
|
||||
|
||||
|
||||
.SH SEE ALSO
|
||||
.PP
|
||||
\fBgit\-bug\-status(1)\fP
|
29
doc/man/git-bug-status-open.1
Normal file
29
doc/man/git-bug-status-open.1
Normal file
@ -0,0 +1,29 @@
|
||||
.TH "GIT-BUG" "1" "Sep 2018" "Generated from git-bug's source code" ""
|
||||
.nh
|
||||
.ad l
|
||||
|
||||
|
||||
.SH NAME
|
||||
.PP
|
||||
git\-bug\-status\-open \- Mark the bug as open
|
||||
|
||||
|
||||
.SH SYNOPSIS
|
||||
.PP
|
||||
\fBgit\-bug status open <id> [flags]\fP
|
||||
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Mark the bug as open
|
||||
|
||||
|
||||
.SH OPTIONS
|
||||
.PP
|
||||
\fB\-h\fP, \fB\-\-help\fP[=false]
|
||||
help for open
|
||||
|
||||
|
||||
.SH SEE ALSO
|
||||
.PP
|
||||
\fBgit\-bug\-status(1)\fP
|
@ -26,4 +26,4 @@ Show the bug status
|
||||
|
||||
.SH SEE ALSO
|
||||
.PP
|
||||
\fBgit\-bug(1)\fP
|
||||
\fBgit\-bug(1)\fP, \fBgit\-bug\-status\-close(1)\fP, \fBgit\-bug\-status\-open(1)\fP
|
||||
|
@ -29,4 +29,4 @@ It use the same internal storage so it doesn't pollute your project. As you woul
|
||||
|
||||
.SH SEE ALSO
|
||||
.PP
|
||||
\fBgit\-bug\-add(1)\fP, \fBgit\-bug\-close(1)\fP, \fBgit\-bug\-commands(1)\fP, \fBgit\-bug\-comment(1)\fP, \fBgit\-bug\-label(1)\fP, \fBgit\-bug\-ls(1)\fP, \fBgit\-bug\-open(1)\fP, \fBgit\-bug\-pull(1)\fP, \fBgit\-bug\-push(1)\fP, \fBgit\-bug\-show(1)\fP, \fBgit\-bug\-status(1)\fP, \fBgit\-bug\-termui(1)\fP, \fBgit\-bug\-title(1)\fP, \fBgit\-bug\-webui(1)\fP
|
||||
\fBgit\-bug\-add(1)\fP, \fBgit\-bug\-commands(1)\fP, \fBgit\-bug\-comment(1)\fP, \fBgit\-bug\-label(1)\fP, \fBgit\-bug\-ls(1)\fP, \fBgit\-bug\-pull(1)\fP, \fBgit\-bug\-push(1)\fP, \fBgit\-bug\-show(1)\fP, \fBgit\-bug\-status(1)\fP, \fBgit\-bug\-termui(1)\fP, \fBgit\-bug\-title(1)\fP, \fBgit\-bug\-webui(1)\fP
|
||||
|
@ -21,12 +21,10 @@ git-bug [flags]
|
||||
### SEE ALSO
|
||||
|
||||
* [git-bug add](git-bug_add.md) - Create a new bug
|
||||
* [git-bug close](git-bug_close.md) - Mark the bug as closed
|
||||
* [git-bug commands](git-bug_commands.md) - Display available commands
|
||||
* [git-bug comment](git-bug_comment.md) - Show a bug's comments
|
||||
* [git-bug label](git-bug_label.md) - Manipulate bug's label
|
||||
* [git-bug ls](git-bug_ls.md) - List bugs
|
||||
* [git-bug open](git-bug_open.md) - Mark the bug as open
|
||||
* [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 show](git-bug_show.md) - Display the details of a bug
|
||||
|
@ -19,4 +19,6 @@ git-bug status <id> [flags]
|
||||
### SEE ALSO
|
||||
|
||||
* [git-bug](git-bug.md) - A bugtracker embedded in Git
|
||||
* [git-bug status close](git-bug_status_close.md) - Mark the bug as closed
|
||||
* [git-bug status open](git-bug_status_open.md) - Mark the bug as open
|
||||
|
||||
|
22
doc/md/git-bug_status_close.md
Normal file
22
doc/md/git-bug_status_close.md
Normal file
@ -0,0 +1,22 @@
|
||||
## git-bug status close
|
||||
|
||||
Mark the bug as closed
|
||||
|
||||
### Synopsis
|
||||
|
||||
Mark the bug as closed
|
||||
|
||||
```
|
||||
git-bug status close <id> [flags]
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for close
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [git-bug status](git-bug_status.md) - Show the bug status
|
||||
|
22
doc/md/git-bug_status_open.md
Normal file
22
doc/md/git-bug_status_open.md
Normal file
@ -0,0 +1,22 @@
|
||||
## git-bug status open
|
||||
|
||||
Mark the bug as open
|
||||
|
||||
### Synopsis
|
||||
|
||||
Mark the bug as open
|
||||
|
||||
```
|
||||
git-bug status open <id> [flags]
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for open
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [git-bug status](git-bug_status.md) - Show the bug status
|
||||
|
@ -277,26 +277,6 @@ _git-bug_add()
|
||||
noun_aliases=()
|
||||
}
|
||||
|
||||
_git-bug_close()
|
||||
{
|
||||
last_command="git-bug_close"
|
||||
|
||||
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_commands()
|
||||
{
|
||||
last_command="git-bug_commands"
|
||||
@ -428,26 +408,6 @@ _git-bug_ls()
|
||||
noun_aliases=()
|
||||
}
|
||||
|
||||
_git-bug_open()
|
||||
{
|
||||
last_command="git-bug_open"
|
||||
|
||||
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_pull()
|
||||
{
|
||||
last_command="git-bug_pull"
|
||||
@ -508,6 +468,46 @@ _git-bug_show()
|
||||
noun_aliases=()
|
||||
}
|
||||
|
||||
_git-bug_status_close()
|
||||
{
|
||||
last_command="git-bug_status_close"
|
||||
|
||||
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_status_open()
|
||||
{
|
||||
last_command="git-bug_status_open"
|
||||
|
||||
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_status()
|
||||
{
|
||||
last_command="git-bug_status"
|
||||
@ -515,6 +515,8 @@ _git-bug_status()
|
||||
command_aliases=()
|
||||
|
||||
commands=()
|
||||
commands+=("close")
|
||||
commands+=("open")
|
||||
|
||||
flags=()
|
||||
two_word_flags=()
|
||||
@ -623,12 +625,10 @@ _git-bug_root_command()
|
||||
|
||||
commands=()
|
||||
commands+=("add")
|
||||
commands+=("close")
|
||||
commands+=("commands")
|
||||
commands+=("comment")
|
||||
commands+=("label")
|
||||
commands+=("ls")
|
||||
commands+=("open")
|
||||
commands+=("pull")
|
||||
commands+=("push")
|
||||
commands+=("show")
|
||||
|
@ -8,7 +8,7 @@ case $state in
|
||||
level1)
|
||||
case $words[1] in
|
||||
git-bug)
|
||||
_arguments '1: :(add close commands comment label ls open pull push show status termui title webui)'
|
||||
_arguments '1: :(add commands comment label ls pull push show status termui title webui)'
|
||||
;;
|
||||
*)
|
||||
_arguments '*: :_files'
|
||||
@ -20,6 +20,9 @@ case $state in
|
||||
comment)
|
||||
_arguments '2: :(add)'
|
||||
;;
|
||||
status)
|
||||
_arguments '2: :(close open)'
|
||||
;;
|
||||
title)
|
||||
_arguments '2: :(edit)'
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user