aboutsummaryrefslogtreecommitdiffstats
path: root/commands/open.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/open.go
parenta846fb96de587afdd9b3ea37bdb9731d77e44863 (diff)
downloadgit-bug-dad61892cea320cd28c23c73fdf65a90404c6099.tar.gz
commands: migrate the open/close commands under the "status" command
Diffstat (limited to 'commands/open.go')
-rw-r--r--commands/open.go48
1 files changed, 0 insertions, 48 deletions
diff --git a/commands/open.go b/commands/open.go
deleted file mode 100644
index db6a5909..00000000
--- a/commands/open.go
+++ /dev/null
@@ -1,48 +0,0 @@
-package commands
-
-import (
- "errors"
-
- "github.com/MichaelMure/git-bug/cache"
- "github.com/spf13/cobra"
-)
-
-func runOpenBug(cmd *cobra.Command, args []string) error {
- if len(args) > 1 {
- return errors.New("Only opening 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.Open()
- if err != nil {
- return err
- }
-
- return b.Commit()
-}
-
-var openCmd = &cobra.Command{
- Use: "open <id>",
- Short: "Mark the bug as open",
- RunE: runOpenBug,
-}
-
-func init() {
- RootCmd.AddCommand(openCmd)
-}