cbeust / jcommander

Command line parsing framework for Java
Apache License 2.0
1.94k stars 332 forks source link

Escaping paramater content #556

Closed priand closed 4 months ago

priand commented 1 year ago

I need to pass a parameter that contains some characters that need to be escaped. For example, command 'I'm the \"walrus\"", where the actual parameter value is I'm the "walrus". Is there a way to do this? bash, for example, allow the use of escaped character. See: https://unix.stackexchange.com/questions/30903/how-to-escape-quotes-in-shell. I didn't find anything equivalent in JCommander.

mkarg commented 10 months ago

We cannot see the actual cause of this inside of JCommander. In fact, it is bash itself which is in your way. Bash is parsing the command line, and passes the arguments to JCommander. In that moment, JCommander cannot re-fix the problem.

mkarg commented 4 months ago

@priand As you did not respond to the last comment I assume my claim was correct, so I am closing this ticket now.