diff options
Diffstat (limited to 'commands/status.go')
-rw-r--r-- | commands/status.go | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/commands/status.go b/commands/status.go index aaf9e636..57771bca 100644 --- a/commands/status.go +++ b/commands/status.go @@ -3,18 +3,17 @@ package commands import ( "github.com/spf13/cobra" - "github.com/MichaelMure/git-bug/cache" "github.com/MichaelMure/git-bug/commands/select" - "github.com/MichaelMure/git-bug/util/interrupt" ) func newStatusCommand() *cobra.Command { env := newEnv() cmd := &cobra.Command{ - Use: "status [<id>]", - Short: "Display or change a bug status.", - PreRunE: loadRepo(env), + Use: "status [<id>]", + Short: "Display or change a bug status.", + PreRunE: loadBackend(env), + PostRunE: closeBackend(env), RunE: func(cmd *cobra.Command, args []string) error { return runStatus(env, args) }, @@ -27,14 +26,7 @@ func newStatusCommand() *cobra.Command { } func runStatus(env *Env, args []string) error { - backend, err := cache.NewRepoCache(env.repo) - if err != nil { - return err - } - defer backend.Close() - interrupt.RegisterCleaner(backend.Close) - - b, args, err := _select.ResolveBug(backend, args) + b, args, err := _select.ResolveBug(env.backend, args) if err != nil { return err } |