aboutsummaryrefslogtreecommitdiffstats
path: root/commands/ls.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/ls.go')
-rw-r--r--commands/ls.go22
1 files changed, 8 insertions, 14 deletions
diff --git a/commands/ls.go b/commands/ls.go
index 1bc2afff..5a5d96c6 100644
--- a/commands/ls.go
+++ b/commands/ls.go
@@ -2,28 +2,22 @@ package commands
import (
"fmt"
- b "github.com/MichaelMure/git-bug/bug"
+ "github.com/MichaelMure/git-bug/bug"
"github.com/MichaelMure/git-bug/util"
"github.com/spf13/cobra"
)
func runLsBug(cmd *cobra.Command, args []string) error {
- ids, err := repo.ListRefs(b.BugsRefPattern)
+ bugs := bug.ReadAllLocalBugs(repo)
- if err != nil {
- return err
- }
-
- for _, ref := range ids {
- bug, err := b.ReadBug(repo, b.BugsRefPattern+ref)
-
- if err != nil {
- return err
+ for b := range bugs {
+ if b.Err != nil {
+ return b.Err
}
- snapshot := bug.Compile()
+ snapshot := b.Bug.Compile()
- var author b.Person
+ var author bug.Person
if len(snapshot.Comments) > 0 {
create := snapshot.Comments[0]
@@ -35,7 +29,7 @@ func runLsBug(cmd *cobra.Command, args []string) error {
authorFmt := fmt.Sprintf("%-15.15s", author.Name)
fmt.Printf("%s %s\t%s\t%s\t%s\n",
- util.Cyan(bug.HumanId()),
+ util.Cyan(b.Bug.HumanId()),
util.Yellow(snapshot.Status),
titleFmt,
util.Magenta(authorFmt),