diff options
Diffstat (limited to 'commands/title_edit.go')
-rw-r--r-- | commands/title_edit.go | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/commands/title_edit.go b/commands/title_edit.go index 111c6325..a62daf6c 100644 --- a/commands/title_edit.go +++ b/commands/title_edit.go @@ -1,10 +1,10 @@ package commands import ( - "errors" "fmt" "github.com/MichaelMure/git-bug/cache" + "github.com/MichaelMure/git-bug/commands/select" "github.com/MichaelMure/git-bug/input" "github.com/spf13/cobra" ) @@ -14,25 +14,13 @@ var ( ) func runTitleEdit(cmd *cobra.Command, args []string) error { - var err error - - if len(args) > 1 { - return errors.New("Only one bug id 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) + b, args, err := _select.ResolveBug(backend, args) if err != nil { return err } @@ -59,7 +47,7 @@ func runTitleEdit(cmd *cobra.Command, args []string) error { } var titleEditCmd = &cobra.Command{ - Use: "edit <id>", + Use: "edit [<id>]", Short: "Edit a bug title", RunE: runTitleEdit, } |