-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect synopsis for char[] options #1834
Labels
Milestone
Comments
I see, yes. Current: if (option.required()) { // e.g., -x=VAL
text = text.concat(name).concat(param).concat("");
if (option.isMultiValue()) { // e.g., -x=VAL [-x=VAL]...
text = text.concat(" [").concat(name).concat(param).concat("]...");
}
} else {
text = text.concat("[").concat(name).concat(param).concat("]");
if (option.isMultiValue()) { // add ellipsis to show option is repeatable
text = text.concat("...");
}
} potential fix: // related: Interpreter#getActualTypeConverter special logic for interactive char[] options... (also: #648)
boolean treatAsSingleValue = char[].class.equals(option.type()) && option.interactive(); // #1834
if (option.required()) { // e.g., -x=VAL
text = text.concat(name).concat(param).concat("");
if (option.isMultiValue() && !treatAsSingleValue) { // e.g., -x=VAL [-x=VAL]...
text = text.concat(" [").concat(name).concat(param).concat("]...");
}
} else {
text = text.concat("[").concat(name).concat(param).concat("]");
if (option.isMultiValue() && !treatAsSingleValue) { // add ellipsis to show option is repeatable
text = text.concat("...");
}
} Will you be able to provide a unit test? |
I'll look into providing a PR with fix and unit test either myself or by my colleague. |
Looking at this more closely, I think #1846 (treating |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
I have some password options defined like the following:
Likely due to this option being defined as an array, the command synopsis in help output and man page show this as a repeatable option:
This is confusing for users, as it makes them think they can specify multiple passwords, whereas in reality they can only specify a single password consisting of multiple characters.
The text was updated successfully, but these errors were encountered: