Skip to content

Commit

Permalink
Print paramLabel only when it could exist
Browse files Browse the repository at this point in the history
  • Loading branch information
joca-bt authored and remkop committed Sep 28, 2021
1 parent 43b8e4e commit 267669a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/picocli/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -14438,7 +14438,9 @@ private static String optionDescription(String prefix, ArgSpec argSpec, int opti
if (argSpec.arity().max > 1) {
desc += " at index " + optionParamIndex;
}
desc += " (" + argSpec.paramLabel() + ")";
if (argSpec.arity().max > 0) {
desc += " (" + argSpec.paramLabel() + ")";
}
}
} else {
desc = prefix + "positional parameter at index " + ((PositionalParamSpec) argSpec).index() + " (" + argSpec.paramLabel() + ")";
Expand Down

0 comments on commit 267669a

Please sign in to comment.