git-bug/commands/status_open.go

38 lines
620 B
Go
Raw Normal View History

2018-07-17 20:28:37 +03:00
package commands
import (
"github.com/MichaelMure/git-bug/cache"
"github.com/MichaelMure/git-bug/commands/select"
"github.com/spf13/cobra"
2018-07-17 20:28:37 +03:00
)
func runStatusOpen(cmd *cobra.Command, args []string) error {
backend, err := cache.NewRepoCache(repo)
if err != nil {
return err
}
defer backend.Close()
b, args, err := _select.ResolveBug(backend, args)
2018-07-17 20:28:37 +03:00
if err != nil {
return err
}
err = b.Open()
if err != nil {
return err
}
return b.Commit()
2018-07-17 20:28:37 +03:00
}
var openCmd = &cobra.Command{
Use: "open [<id>]",
2018-09-21 14:37:22 +03:00
Short: "Mark a bug as open",
RunE: runStatusOpen,
}
func init() {
statusCmd.AddCommand(openCmd)
2018-07-17 20:28:37 +03:00
}