Skip to content
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

Various improvements to default values #267

Closed
wants to merge 2 commits into from

Conversation

ymenager
Copy link

Various improvements to default values (standard behavior remains the same, all features are options and must be enabled explicitely):

  • bugfix: Default values couldn't be read from non-public fields (was missing setAccessible())
  • mask default value: This allows to specify a mask string in @options that will be displayed instead of any existing default value (will not be displayed if no default value exists)
  • notRequiredWithDefault in @command allows a default value in a required field to become non-required
  • refreshDefaultValues() added to CommandLine

Unit tests for all features included

… same, all features are options and must be enabled explicitely):

- bugfix: Default values couldn't be read from non-public fields (was missing setAccessible())
- mask default value: This allows to specify a mask string in @options that will be displayed instead of any existing default value (will not be displayed if no default value exists)
- notRequiredWithDefault in @command allows a default value in a required field to become non-required
- refreshDefaultValues() added to CommandLine

Unit tests for all features included
…(getDefaultValue(scope, field)); can go back to being in it's original location
@codecov-io
Copy link

Codecov Report

Merging #267 into master will decrease coverage by 0.22%.
The diff coverage is 77.55%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #267      +/-   ##
============================================
- Coverage     90.21%   89.98%   -0.23%     
- Complexity      165      173       +8     
============================================
  Files             4        4              
  Lines          2350     2396      +46     
  Branches        591      602      +11     
============================================
+ Hits           2120     2156      +36     
- Misses          102      107       +5     
- Partials        128      133       +5
Impacted Files Coverage Δ Complexity Δ
src/main/java/picocli/CommandLine.java 89.78% <77.55%> (-0.26%) 91 <8> (+8)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ac51a2...9917f6f. Read the comment docs.

@remkop
Copy link
Owner

remkop commented Apr 3, 2018

Implemented, see comment on #261.

@remkop remkop closed this Apr 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants