Skip to content

Change % to %% when using ${DEFAULT-VALUE} in option description #643

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

Merged
merged 1 commit into from
Mar 13, 2019
Merged

Change % to %% when using ${DEFAULT-VALUE} in option description #643

merged 1 commit into from
Mar 13, 2019

Conversation

StefRe
Copy link
Contributor

@StefRe StefRe commented Mar 13, 2019

Percent signs shall be escaped in the description text as it is going
to be passed to String.format. If the default value contains (single) %
signs then using the built-in DEFAULT-VALUE variable would lead to a
warning message. This is avoided by escaping any % signs in the
DEFAULT-VALUE variable when used in the description.

This is related to #615 and its fix. I have an option with a default value of "%s - page %d of %d" and using ${DEFAULT-VALUE} in the description leads to the warning message. A workaround would have been to not use ${DEFAULT-VALUE} but instead writing the default value with doulbe % signs in the description but I definitely prefer the use of the variable just in case the default changes some time later.

Percent signs shall be escaped in the description text as it is going
to be passed to String.format. If the default value contains (single) %
signs then using the built-in DEFAULT-VALUE variable would lead to a
warning message. This is avoided by escaping any % signs in the
DEFAULT-VALUE variable when used in the description.
@codecov-io
Copy link

codecov-io commented Mar 13, 2019

Codecov Report

Merging #643 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #643   +/-   ##
=========================================
  Coverage     97.61%   97.61%           
  Complexity      363      363           
=========================================
  Files             4        4           
  Lines          4569     4569           
  Branches       1137     1137           
=========================================
  Hits           4460     4460           
  Misses           27       27           
  Partials         82       82
Impacted Files Coverage Δ Complexity Δ
src/main/java/picocli/CommandLine.java 97.5% <100%> (ø) 195 <0> (ø) ⬇️

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 66f0cd9...58d9bba. Read the comment docs.

@remkop remkop added this to the 4.0 milestone Mar 13, 2019
@remkop remkop merged commit 2725208 into remkop:master Mar 13, 2019
@remkop
Copy link
Owner

remkop commented Mar 13, 2019

Thank you for the PR!
This has been merged and will be included in the next release.

@remkop remkop modified the milestones: 4.0, 4.0-alpha-1 Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants