mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-14 17:51:44 +03:00
ls-id.go: Fixing ls-id
Adding check for length of args Pulling bugIds from correct backend.
This commit is contained in:
parent
fe8b0659c9
commit
a45ece05e6
@ -10,9 +10,17 @@ import (
|
|||||||
|
|
||||||
func runLsID(cmd *cobra.Command, args []string) error {
|
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() {
|
for _, id := range backend.AllBugsIds() {
|
||||||
if prefix == "" || strings.HasPrefix(id, prefix) {
|
if prefix == "" || strings.HasPrefix(id, prefix) {
|
||||||
|
Loading…
Reference in New Issue
Block a user