diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-16 14:29:14 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-16 14:29:14 +0200 |
commit | dad61892cea320cd28c23c73fdf65a90404c6099 (patch) | |
tree | da964d3af2001027ef880d93cf5914ecd40984e8 /commands/close.go | |
parent | a846fb96de587afdd9b3ea37bdb9731d77e44863 (diff) | |
download | git-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.go | 48 |
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) -} |