You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected result is that with such configuration raw arguments will all match the parsed arguments.
This becomes important when an app expects parameters where quotes are important, such as search query or search criteria. The workaround for me now is to include a space in the beginning or at the end of the argument, as illustrated in the last argument above.
This looks to be caused by trim() / unquote() implementation:
Is there any historical context why the quotes are removed? Should we consider changing this behavior to pass through any quotes passed by the shell? If this is not desirable for certain reasons, how about an alternative solution with adding boolean raw() default false to Parameters and Option annotations and taking raw into account before trimming?
The text was updated successfully, but these errors were encountered:
Picocli 3.7 fixes this issue (and related issue #379 - quoted strings are no longer split by the split regex).
JCommander users may also be interested since apparently this is still an issue in the latest version of JCommander, based on cbeust/jcommander#458
(Related: cbeust/jcommander#153 )
Looks like picocli always trims leading and trailing quotes of the arguments, even if they were passed explicitly.
Consider this sample class:
Look at these sample arguments and actual result:
Expected result is that with such configuration raw arguments will all match the parsed arguments.
This becomes important when an app expects parameters where quotes are important, such as search query or search criteria. The workaround for me now is to include a space in the beginning or at the end of the argument, as illustrated in the last argument above.
This looks to be caused by trim() / unquote() implementation:
Is there any historical context why the quotes are removed? Should we consider changing this behavior to pass through any quotes passed by the shell? If this is not desirable for certain reasons, how about an alternative solution with adding
boolean raw() default false
toParameters
andOption
annotations and takingraw
into account before trimming?The text was updated successfully, but these errors were encountered: