aboutsummaryrefslogtreecommitdiffstats
path: root/commands/close.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-16 14:29:14 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-16 14:29:14 +0200
commitdad61892cea320cd28c23c73fdf65a90404c6099 (patch)
treeda964d3af2001027ef880d93cf5914ecd40984e8 /commands/close.go
parenta846fb96de587afdd9b3ea37bdb9731d77e44863 (diff)
downloadgit-bug-dad61892cea320cd28c23c73fdf65a90404c6099.tar.gz
commands: migrate the open/close commands under the "status" command
Diffstat (limited to 'commands/close.go')
-rw-r--r--commands/close.go48
1 files changed, 0 insertions, 48 deletions
diff --git a/commands/close.go b/commands/close.go
deleted file mode 100644
index 890702dd..00000000
--- a/commands/close.go
+++ /dev/null
@@ -1,48 +0,0 @@
-package commands
-
-import (
- "errors"
-
- "github.com/MichaelMure/git-bug/cache"
- "github.com/spf13/cobra"
-)
-
-func runCloseBug(cmd *cobra.Command, args []string) error {
- if len(args) > 1 {
- return errors.New("Only closing one bug at a time is supported")
- }
-
- if len(args) == 0 {
- return errors.New("You must provide a bug id")
- }
-
- backend, err := cache.NewRepoCache(repo)
- if err != nil {
- return err
- }
- defer backend.Close()
-
- prefix := args[0]
-
- b, err := backend.ResolveBugPrefix(prefix)
- if err != nil {
- return err
- }
-
- err = b.Close()
- if err != nil {
- return err
- }
-
- return b.Commit()
-}
-
-var closeCmd = &cobra.Command{
- Use: "close <id>",
- Short: "Mark the bug as closed",
- RunE: runCloseBug,
-}
-
-func init() {
- RootCmd.AddCommand(closeCmd)
-}