Skip to content

Commit

Permalink
INFRA-541 Fix arg parsing corner case
Browse files Browse the repository at this point in the history
  • Loading branch information
Ned Leitch committed Sep 6, 2024
1 parent a8a33cf commit 30e8db4
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ private static String[] extractArgs(String prefix, String[] allArgs) {
accumulator.add("-" + arg.substring(argPrefix.length()));
}
else {
if (!(arg.startsWith("-") || accumulator.isEmpty())) {
accumulator.add(arg);
if (arg.startsWith("-")) {
matchingArgs.addAll(accumulator);
accumulator.clear();
} else {
if (!accumulator.isEmpty()) {
accumulator.add(arg);
}
}
}
}
Expand Down

0 comments on commit 30e8db4

Please sign in to comment.