aboutsummaryrefslogtreecommitdiffstats
path: root/commands/close.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/close.go')
-rw-r--r--commands/close.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/commands/close.go b/commands/close.go
index 15f50926..66c2b84d 100644
--- a/commands/close.go
+++ b/commands/close.go
@@ -4,10 +4,10 @@ import (
"errors"
"github.com/MichaelMure/git-bug/bug"
"github.com/MichaelMure/git-bug/bug/operations"
- "github.com/MichaelMure/git-bug/repository"
+ "github.com/spf13/cobra"
)
-func runCloseBug(repo repository.Repo, args []string) error {
+func runCloseBug(cmd *cobra.Command, args []string) error {
if len(args) > 1 {
return errors.New("Only closing one bug at a time is supported")
}
@@ -37,8 +37,12 @@ func runCloseBug(repo repository.Repo, args []string) error {
return err
}
-var closeCmd = &Command{
- Description: "Mark the bug as closed",
- Usage: "<id>",
- RunMethod: runCloseBug,
+var closeCmd = &cobra.Command{
+ Use: "close <id>",
+ Short: "Mark the bug as closed",
+ RunE: runCloseBug,
+}
+
+func init() {
+ rootCmd.AddCommand(closeCmd)
}