diff options
author | Sladyn <gunnerforlife00@gmail.com> | 2019-03-05 00:03:38 +0530 |
---|---|---|
committer | Sladyn <gunnerforlife00@gmail.com> | 2019-03-05 00:03:38 +0530 |
commit | a45ece05e6cc02f8f9d8e669cc5ea942b0728eaa (patch) | |
tree | 7afaba3a9b02b269f55225aa03934cdaf8cb00bb | |
parent | fe8b0659c9bc1cb074a5acfbafcabd603e533f9f (diff) | |
download | git-bug-a45ece05e6cc02f8f9d8e669cc5ea942b0728eaa.tar.gz |
ls-id.go: Fixing ls-id
Adding check for length of args
Pulling bugIds from correct backend.
-rw-r--r-- | commands/ls-id.go | 12 |
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) { |