Skip to content

Commit

Permalink
cmd/util: fix handle of unknown number of arguments
Browse files Browse the repository at this point in the history
Instead of returning an error in case of an unknown number of args, let
it return the nil values and let the caller handle it as it please. For
"mr_note", "issue_note" and "mr_edit" the error was interrumpting the
cmd line argument parser.

Fixes: ecd57aa ("cmd/util: avoid an empty string to be parsed")
Signed-off-by: Bruno Meneguele <[email protected]>
  • Loading branch information
bmeneg committed Jun 28, 2021
1 parent e9930eb commit d4c4280
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,6 @@ func filterCommentArg(args []string) (int, []string, error) {
} else if len(args) == 2 {
branchArgs = append(branchArgs, args[0])
idString = args[1]
} else {
return 0, branchArgs, fmt.Errorf("unsupported number of arguments")
}

if strings.Contains(idString, ":") {
Expand Down

0 comments on commit d4c4280

Please sign in to comment.