From f70f38c8ee44338e803ba6bb306c13fe1c7f347a Mon Sep 17 00:00:00 2001 From: Sladyn Date: Fri, 8 Feb 2019 23:55:19 +0530 Subject: [PATCH 1/2] ls-id.go: Add ls-id [] command This file adds the ls-id command which returns the bug id matching the prefix the user enters. If no prefix entered it lists all the BugId's Closes https://github.com/MichaelMure/git-bug/issues/47 --- commands/ls-id.go | 80 ++++++++++++++++++++++++++++++ doc/man/git-bug-add.1 | 2 +- doc/man/git-bug-bridge-configure.1 | 2 +- doc/man/git-bug-bridge-pull.1 | 2 +- doc/man/git-bug-bridge-rm.1 | 2 +- doc/man/git-bug-bridge.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-deselect.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-label.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-select.1 | 2 +- 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-termui.1 | 2 +- doc/man/git-bug-title-edit.1 | 2 +- doc/man/git-bug-title.1 | 2 +- doc/man/git-bug-webui.1 | 2 +- doc/man/git-bug.1 | 4 +- doc/md/git-bug.md | 1 + misc/bash_completion/git-bug | 21 ++++++++ misc/zsh_completion/git-bug | 2 +- 30 files changed, 130 insertions(+), 28 deletions(-) create mode 100644 commands/ls-id.go diff --git a/commands/ls-id.go b/commands/ls-id.go new file mode 100644 index 0000000000000000000000000000000000000000..6e6da4c1df5c5115f39b084131d8f7af48e0e284 --- /dev/null +++ b/commands/ls-id.go @@ -0,0 +1,80 @@ +package commands + +import ( + "fmt" + "strings" + + "github.com/MichaelMure/git-bug/bug" + "github.com/spf13/cobra" +) + +func runLsID(cmd *cobra.Command, args []string) error { + + if len(args) < 1 { + _, err := ListAllID() + + if err != nil { + return err + } + + return nil + } + answer, err := ListID(args[0]) + + if err != nil { + return err + } + + if answer == "" { + fmt.Printf("No matching bug Id with prefix %s\n", args[0]) + } else { + fmt.Println(answer) + } + + return nil +} + +//ListID lists the local bug id after taking the prefix as input +func ListID(prefix string) (string, error) { + + IDlist, err := bug.ListLocalIds(repo) + + if err != nil { + return "", err + } + + for _, id := range IDlist { + if strings.HasPrefix(id, prefix) { + return id, nil + } + } + + return "", nil + +} + +//ListAllID lists all the local bug id +func ListAllID() (string, error) { + + IDlist, err := bug.ListLocalIds(repo) + if err != nil { + return "", err + } + + for _, id := range IDlist { + fmt.Println(id) + } + + return "", nil +} + +var listBugIDCmd = &cobra.Command{ + Use: "ls-id []", + Short: "List Bug Id", + PreRunE: loadRepo, + RunE: runLsID, +} + +func init() { + RootCmd.AddCommand(listBugIDCmd) +} diff --git a/doc/man/git-bug-add.1 b/doc/man/git-bug-add.1 index 4ad632a9a0c42ac01c20332bdcb57b411389e87d..dffec9043c1602c2f19fbad0822ad157ef3c2dc3 100644 --- a/doc/man/git-bug-add.1 +++ b/doc/man/git-bug-add.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-bridge-configure.1 b/doc/man/git-bug-bridge-configure.1 index 62ff07e686e6944717d73b59f03d3dc9e933ccd3..e84258f7e4101b7f35090f4103d7a2051d02643e 100644 --- a/doc/man/git-bug-bridge-configure.1 +++ b/doc/man/git-bug-bridge-configure.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-bridge-pull.1 b/doc/man/git-bug-bridge-pull.1 index 26bd210eafc91d89e82f3f79ad0006bcf0f59b21..c9f117c72ab3fb2b9948456979057a9501d4956c 100644 --- a/doc/man/git-bug-bridge-pull.1 +++ b/doc/man/git-bug-bridge-pull.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-bridge-rm.1 b/doc/man/git-bug-bridge-rm.1 index 2d28dea60fcb8fd2b93a1744a1ede4741ac2f3a1..7f538accc3454913a97a0fa9e793e0f37fe1a99a 100644 --- a/doc/man/git-bug-bridge-rm.1 +++ b/doc/man/git-bug-bridge-rm.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-bridge.1 b/doc/man/git-bug-bridge.1 index b182c658884c945b1c76e40b2bee4b346a0da732..4eeb627abb8dbb498711223439b805190c413183 100644 --- a/doc/man/git-bug-bridge.1 +++ b/doc/man/git-bug-bridge.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-commands.1 b/doc/man/git-bug-commands.1 index 0f4603876e7152264f9e79d4e5c249fae86672ee..d959b2c933aef875a2f2ed9a13799f152b19f207 100644 --- a/doc/man/git-bug-commands.1 +++ b/doc/man/git-bug-commands.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-comment-add.1 b/doc/man/git-bug-comment-add.1 index 6095a87f3bda08f3491fe2f9f804797989f66310..8a7ce4fa0d2a5984c4aabdc790d1a087775528d6 100644 --- a/doc/man/git-bug-comment-add.1 +++ b/doc/man/git-bug-comment-add.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-comment.1 b/doc/man/git-bug-comment.1 index 0cb834befe9e3b14fcb7a359a57406acc56d1b0a..4b5300f4d205ac13f784accfab0565e6dfa82008 100644 --- a/doc/man/git-bug-comment.1 +++ b/doc/man/git-bug-comment.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-deselect.1 b/doc/man/git-bug-deselect.1 index 602365d6f242d8dc3db873def739fcd7781609a4..35f45501cbe185d9128e6517b78872884085ee66 100644 --- a/doc/man/git-bug-deselect.1 +++ b/doc/man/git-bug-deselect.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-label-add.1 b/doc/man/git-bug-label-add.1 index 107989089038111ca09076b7e057e050cbe446e6..5cbdbb6a75b69eea81abad8f708dfad97fdbbd34 100644 --- a/doc/man/git-bug-label-add.1 +++ b/doc/man/git-bug-label-add.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-label-rm.1 b/doc/man/git-bug-label-rm.1 index fc33c3d783eb5403c0cb534b72ba60b8311223ff..fb7efdc9bf6171996bfc216ce5bf43cb3fa7f56e 100644 --- a/doc/man/git-bug-label-rm.1 +++ b/doc/man/git-bug-label-rm.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-label.1 b/doc/man/git-bug-label.1 index 68ab672628557a69aebf1cf5ca76c19177a4aa89..d4cde473331931a9dc7df85783b5cd037af39a8f 100644 --- a/doc/man/git-bug-label.1 +++ b/doc/man/git-bug-label.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-ls-label.1 b/doc/man/git-bug-ls-label.1 index 25eb7074bcade8137f087042d4c6832da04dd5b6..1b69b3050bab878d8119d7f5c79138df3ad1b2d1 100644 --- a/doc/man/git-bug-ls-label.1 +++ b/doc/man/git-bug-ls-label.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-ls.1 b/doc/man/git-bug-ls.1 index 8a96ca77952e1f4bd375e970b2987c421d931f4e..e9cdb4c883c4a857d605b1f1ee34761ecc943650 100644 --- a/doc/man/git-bug-ls.1 +++ b/doc/man/git-bug-ls.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-pull.1 b/doc/man/git-bug-pull.1 index 5614534d03f35ff29be63fd10c10c9a85447023c..315ce01a0492f177697274091d3623682e047dc1 100644 --- a/doc/man/git-bug-pull.1 +++ b/doc/man/git-bug-pull.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-push.1 b/doc/man/git-bug-push.1 index 4779318bed792160594dcc44702695a0c7b0371e..0466e0efcd427c2a96dc67db6b4081c515254bde 100644 --- a/doc/man/git-bug-push.1 +++ b/doc/man/git-bug-push.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-select.1 b/doc/man/git-bug-select.1 index f073019446d2f88dcef0784af24f11b088db4784..9324a87335c85b0ef56f3dc984ed5ca4fa1339a9 100644 --- a/doc/man/git-bug-select.1 +++ b/doc/man/git-bug-select.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-show.1 b/doc/man/git-bug-show.1 index 05f856e97a24edda0b093207850bc5a669f7ab90..443b75ec2ac3b0cbee1a727b8eed946d42d8184e 100644 --- a/doc/man/git-bug-show.1 +++ b/doc/man/git-bug-show.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-status-close.1 b/doc/man/git-bug-status-close.1 index 71e9cdfe7c4da0eb83567c3a955a2ce132b6a6a0..9552d0375e8614f6758510674771277eb8fc8220 100644 --- a/doc/man/git-bug-status-close.1 +++ b/doc/man/git-bug-status-close.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-status-open.1 b/doc/man/git-bug-status-open.1 index 0e7fe8ae2ef76537f3c05cd38cb8de7a425c433f..9f7b69cf11082e6199d8de841d8f5e60b0963364 100644 --- a/doc/man/git-bug-status-open.1 +++ b/doc/man/git-bug-status-open.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-status.1 b/doc/man/git-bug-status.1 index 0f2e1b40c7b3e39eb82dcf428bb2c1cd19bc7466..c31e542df07c29681557663945eb18ba20a6c766 100644 --- a/doc/man/git-bug-status.1 +++ b/doc/man/git-bug-status.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-termui.1 b/doc/man/git-bug-termui.1 index 9f66a00f8195503a527c2d696814a372e4d8a337..d395ab06c93f064e8f5fad5cb361d1bc30e55498 100644 --- a/doc/man/git-bug-termui.1 +++ b/doc/man/git-bug-termui.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-title-edit.1 b/doc/man/git-bug-title-edit.1 index 4012fcbb11691ee73add75c3eb48d51ac685799e..ab33c4aea921c871f0e4b258e3a66ff51ae4bee8 100644 --- a/doc/man/git-bug-title-edit.1 +++ b/doc/man/git-bug-title-edit.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-title.1 b/doc/man/git-bug-title.1 index 6888fe8e9fc329c33621e0596b63b9f07fc01d43..5dc58465ee692226b084b5aad78587d32f25e61c 100644 --- a/doc/man/git-bug-title.1 +++ b/doc/man/git-bug-title.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug-webui.1 b/doc/man/git-bug-webui.1 index 0310b1308de93316097388992ce0c9c1ef4843e7..5ca9e4e95023fac9cf0b7af9b0bfde9accaf281c 100644 --- a/doc/man/git-bug-webui.1 +++ b/doc/man/git-bug-webui.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l diff --git a/doc/man/git-bug.1 b/doc/man/git-bug.1 index 183d60d846741da4095778883c97747d6f90d7b1..6a5e290167d30aeafeef7a2132c838a88de6a836 100644 --- a/doc/man/git-bug.1 +++ b/doc/man/git-bug.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" .nh .ad l @@ -31,4 +31,4 @@ the same git remote your are already using to collaborate with other peoples. .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\-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\-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\-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\-webui(1)\fP diff --git a/doc/md/git-bug.md b/doc/md/git-bug.md index 2cc44eff3efac757d7900ccaf91170ed02d2d310..4acec84c26b25faa7589bd1d30d619c3a5b0b8f9 100644 --- a/doc/md/git-bug.md +++ b/doc/md/git-bug.md @@ -31,6 +31,7 @@ git-bug [flags] * [git-bug deselect](git-bug_deselect.md) - Clear the implicitly selected bug * [git-bug label](git-bug_label.md) - Display, add or remove labels * [git-bug ls](git-bug_ls.md) - List bugs +* [git-bug ls-id](git-bug_ls-id.md) - List Bug Id * [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 diff --git a/misc/bash_completion/git-bug b/misc/bash_completion/git-bug index d6c282141c460d37b29b3d6ce8142664d38f02fa..3870e3a02e8bff08ed515c7409a71bca73c1233e 100644 --- a/misc/bash_completion/git-bug +++ b/misc/bash_completion/git-bug @@ -550,6 +550,26 @@ _git-bug_ls() noun_aliases=() } +_git-bug_ls-id() +{ + last_command="git-bug_ls-id" + + 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_ls-label() { last_command="git-bug_ls-label" @@ -816,6 +836,7 @@ _git-bug_root_command() commands+=("deselect") commands+=("label") commands+=("ls") + commands+=("ls-id") commands+=("ls-label") commands+=("pull") commands+=("push") diff --git a/misc/zsh_completion/git-bug b/misc/zsh_completion/git-bug index 2deae54802e08c86406e291bac1a486d1c577230..c8cc7c2cb81da849fba13d1d6e0cc257636e350a 100644 --- a/misc/zsh_completion/git-bug +++ b/misc/zsh_completion/git-bug @@ -8,7 +8,7 @@ case $state in level1) case $words[1] in git-bug) - _arguments '1: :(add bridge commands comment deselect label ls ls-label pull push select show status termui title webui)' + _arguments '1: :(add bridge commands comment deselect label ls ls-id ls-label pull push select show status termui title webui)' ;; *) _arguments '*: :_files' From 3c0c13bbbe934d0fa9476fa5c07bf04ea5a99b94 Mon Sep 17 00:00:00 2001 From: Sladyn Date: Thu, 14 Feb 2019 00:38:55 +0530 Subject: [PATCH 2/2] ls-id.go:Add ls-id [] command This file adds the ls-id command which returns the bug id matching the prefix the user enters. If no prefix entered it lists all the BugId's Closes #47 --- commands/ls-id.go | 59 +++++-------------------------------- doc/man/git-bug.1 | 4 +-- misc/zsh_completion/git-bug | 2 +- 3 files changed, 10 insertions(+), 55 deletions(-) diff --git a/commands/ls-id.go b/commands/ls-id.go index 6e6da4c1df5c5115f39b084131d8f7af48e0e284..b98668282d4310fbf29050efc9faccde5823f8a3 100644 --- a/commands/ls-id.go +++ b/commands/ls-id.go @@ -4,68 +4,23 @@ import ( "fmt" "strings" - "github.com/MichaelMure/git-bug/bug" + "github.com/MichaelMure/git-bug/cache" "github.com/spf13/cobra" ) func runLsID(cmd *cobra.Command, args []string) error { - if len(args) < 1 { - _, err := ListAllID() + var backend *cache.RepoCache - if err != nil { - return err - } - - return nil - } - answer, err := ListID(args[0]) - - if err != nil { - return err - } - - if answer == "" { - fmt.Printf("No matching bug Id with prefix %s\n", args[0]) - } else { - fmt.Println(answer) - } - - return nil -} - -//ListID lists the local bug id after taking the prefix as input -func ListID(prefix string) (string, error) { - - IDlist, err := bug.ListLocalIds(repo) + prefix := args[0] - if err != nil { - return "", err - } - - for _, id := range IDlist { - if strings.HasPrefix(id, prefix) { - return id, nil + for _, id := range backend.AllBugsIds() { + if prefix == "" || strings.HasPrefix(id, prefix) { + fmt.Println(id) } } - return "", nil - -} - -//ListAllID lists all the local bug id -func ListAllID() (string, error) { - - IDlist, err := bug.ListLocalIds(repo) - if err != nil { - return "", err - } - - for _, id := range IDlist { - fmt.Println(id) - } - - return "", nil + return nil } var listBugIDCmd = &cobra.Command{ diff --git a/doc/man/git-bug.1 b/doc/man/git-bug.1 index 6a5e290167d30aeafeef7a2132c838a88de6a836..183d60d846741da4095778883c97747d6f90d7b1 100644 --- a/doc/man/git-bug.1 +++ b/doc/man/git-bug.1 @@ -1,4 +1,4 @@ -.TH "GIT-BUG" "1" "Feb 2019" "Generated from git-bug's source code" "" +.TH "GIT-BUG" "1" "Dec 2018" "Generated from git-bug's source code" "" .nh .ad l @@ -31,4 +31,4 @@ the same git remote your are already using to collaborate with other peoples. .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\-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\-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\-webui(1)\fP diff --git a/misc/zsh_completion/git-bug b/misc/zsh_completion/git-bug index c8cc7c2cb81da849fba13d1d6e0cc257636e350a..2deae54802e08c86406e291bac1a486d1c577230 100644 --- a/misc/zsh_completion/git-bug +++ b/misc/zsh_completion/git-bug @@ -8,7 +8,7 @@ case $state in level1) case $words[1] in git-bug) - _arguments '1: :(add bridge commands comment deselect label ls ls-id ls-label pull push select show status termui title webui)' + _arguments '1: :(add bridge commands comment deselect label ls ls-label pull push select show status termui title webui)' ;; *) _arguments '*: :_files'