aboutsummaryrefslogtreecommitdiffstats
path: root/commands/ls-id.go
diff options
context:
space:
mode:
authorSladyn <gunnerforlife00@gmail.com>2019-03-05 00:03:38 +0530
committerSladyn <gunnerforlife00@gmail.com>2019-03-05 00:03:38 +0530
commita45ece05e6cc02f8f9d8e669cc5ea942b0728eaa (patch)
tree7afaba3a9b02b269f55225aa03934cdaf8cb00bb /commands/ls-id.go
parentfe8b0659c9bc1cb074a5acfbafcabd603e533f9f (diff)
downloadgit-bug-a45ece05e6cc02f8f9d8e669cc5ea942b0728eaa.tar.gz
ls-id.go: Fixing ls-id
Adding check for length of args Pulling bugIds from correct backend.
Diffstat (limited to 'commands/ls-id.go')
-rw-r--r--commands/ls-id.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/commands/ls-id.go b/commands/ls-id.go
index b9866828..55548556 100644
--- a/commands/ls-id.go
+++ b/commands/ls-id.go
@@ -10,9 +10,17 @@ import (
func runLsID(cmd *cobra.Command, args []string) error {
- var backend *cache.RepoCache
+ backend, err := cache.NewRepoCache(repo)
+ if err != nil {
+ return err
+ }
+ defer backend.Close()
- prefix := args[0]
+ var prefix string
+ prefix = ""
+ if len(args) != 0 {
+ prefix = args[0]
+ }
for _, id := range backend.AllBugsIds() {
if prefix == "" || strings.HasPrefix(id, prefix) {