-
Couldn't load subscription status.
- Fork 6
Disable "null..." comment in primitive types #118
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -644,7 +644,7 @@ private void printOptionParamUsage(final StringBuilder sb, final String name, fi | |
| } | ||
|
|
||
| int numSpaces = OPTION_COLUMN_WIDTH - optionLabel.length(); | ||
| if (optionLabel.length() > OPTION_COLUMN_WIDTH) { | ||
| if (optionLabel.length() > OPTION_COLUMN_WIDTH - 1) { | ||
| sb.append("\n"); | ||
| numSpaces = OPTION_COLUMN_WIDTH; | ||
| } | ||
|
|
@@ -672,7 +672,7 @@ private String makeOptionDescription(final OptionDefinition optionDefinition) { | |
| sb.append("Default value: "); | ||
| sb.append(optionDefinition.defaultValue); | ||
| sb.append(". "); | ||
| if (!optionDefinition.defaultValue.equals("null")) { | ||
| if (!optionDefinition.defaultValue.equals("null") && !optionDefinition.field.getType().isPrimitive() ) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line does not appear in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The other parser does allow "null" for optional args. There are some tests there for it, but please make the same change to check for isPrimitive and add the same usage test there as well. |
||
| sb.append("This option can be set to 'null' to clear the default value. "); | ||
| } | ||
| } else if (!optionDefinition.isCollection) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this only happen in the legacy parser? I guess that for concordance, it should be modified in the
CommandLineArgumentParserThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this change in the other parser as well ?