mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 10:12:06 +03:00
36 lines
618 B
Go
36 lines
618 B
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
b "github.com/MichaelMure/git-bug/bug"
|
|
"github.com/MichaelMure/git-bug/repository"
|
|
)
|
|
|
|
func runLsBug(repo repository.Repo, args []string) error {
|
|
ids, err := repo.ListRefs(b.BugsRefPattern)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
for _, ref := range ids {
|
|
bug, err := b.ReadBug(repo, b.BugsRefPattern+ref)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
snapshot := bug.Compile()
|
|
|
|
fmt.Printf("%s %s\t%s\n", bug.HumanId(), snapshot.Title, snapshot.Summary())
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
var lsCmd = &Command{
|
|
Description: "Display a summary of all bugs",
|
|
Usage: "",
|
|
RunMethod: runLsBug,
|
|
}
|