aboutsummaryrefslogtreecommitdiffstats
path: root/commands/ls.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/ls.go')
-rw-r--r--commands/ls.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/commands/ls.go b/commands/ls.go
index 0d188833..fe3f9288 100644
--- a/commands/ls.go
+++ b/commands/ls.go
@@ -3,11 +3,11 @@ package commands
import (
"fmt"
b "github.com/MichaelMure/git-bug/bug"
- "github.com/MichaelMure/git-bug/repository"
"github.com/MichaelMure/git-bug/util"
+ "github.com/spf13/cobra"
)
-func runLsBug(repo repository.Repo, args []string) error {
+func runLsBug(cmd *cobra.Command, args []string) error {
ids, err := repo.ListRefs(b.BugsRefPattern)
if err != nil {
@@ -46,8 +46,12 @@ func runLsBug(repo repository.Repo, args []string) error {
return nil
}
-var lsCmd = &Command{
- Description: "Display a summary of all bugs",
- Usage: "",
- RunMethod: runLsBug,
+var lsCmd = &cobra.Command{
+ Use: "ls",
+ Short: "Display a summary of all bugs",
+ RunE: runLsBug,
+}
+
+func init() {
+ rootCmd.AddCommand(lsCmd)
}