From f67c57c08407b935c82b8f47d36823725351efe0 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 17 Oct 2018 20:59:36 +0200 Subject: commands: check the bug id before the user write the message for "comment add" --- commands/comment_add.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'commands') diff --git a/commands/comment_add.go b/commands/comment_add.go index d720a09b..5a7cd6a8 100644 --- a/commands/comment_add.go +++ b/commands/comment_add.go @@ -21,6 +21,11 @@ func runCommentAdd(cmd *cobra.Command, args []string) error { } defer backend.Close() + b, args, err := _select.ResolveBug(backend, args) + if err != nil { + return err + } + if commentAddMessageFile != "" && commentAddMessage == "" { commentAddMessage, err = input.FromFile(commentAddMessageFile) if err != nil { @@ -39,11 +44,6 @@ func runCommentAdd(cmd *cobra.Command, args []string) error { } } - b, args, err := _select.ResolveBug(backend, args) - if err != nil { - return err - } - err = b.AddComment(commentAddMessage) if err != nil { return err -- cgit