-
Notifications
You must be signed in to change notification settings - Fork 333
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
Cannot use @-syntax in conjunction with arguments starting with literal @ #501
Comments
Issue #462 might be related:
|
Proposed SolutionJCommander should have a new option which allows using |
See also #330. |
Hello, I want to try to work on this issue. |
@c-kunz Thank you for reporting this bug! It was fixed some minutes ago, and will be contained in either 1.83.1 or 1.84 (whatever comes first). |
Description
One cannot use the
@
-syntax in conjunction with parameters that may contain a literal@
at the beginning.Steps to reproduce:
In this repository: https://github.com/c-kunz/jcommander-conflicting-at-syntax
git clone https://github.com/c-kunz/jcommander-conflicting-at-syntax cd jcommander-conflicting-at-syntax mvn clean package java -jar target/demo-jar-with-dependencies.jar -password @X
Expected result
JCommander is able to parse the argument beginning with the literal
@
while also being able to parse additional arguments using the@
-syntax.Actual result
JCommander interprets the argument starting with a literal
@
as a file containing additional arguments (@
-syntax):Exception in thread "main" com.beust.jcommander.ParameterException: Could not read file X: java.nio.file.NoSuchFileException: X
Workaround
One has to settle for the following workaround, basically disabling the
@
-syntax altogether:Proposal
Since this is an either-or situation, either disabling
@
-syntax or prohibiting arguments starting with a literal@
, it would be nice to be able to for example specify parameters that lookup additional arguments in a file or specify parameters that ignore leading@
signs.The text was updated successfully, but these errors were encountered: