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

Abbreviated options are not matched if value attached with '=' separator (like -x=3) #1162

Closed
remkop opened this issue Aug 31, 2020 · 1 comment
Labels
theme: parser An issue or change related to the parser type: bug 🐛
Milestone

Comments

@remkop
Copy link
Owner

remkop commented Aug 31, 2020

Related to #1159: Abbreviated options are not matched if value attached with '=' separator.

Test to reproduce the issue:

@Test
public void testAbbreviatedOptionWithAttachedValue() {
    @Command
    class Bean {
        @Option(names = "--xxx-yyy")
        int x;
    }
    Bean bean = new Bean();
    CommandLine cmd = new CommandLine(bean);
    cmd.setAbbreviatedOptionsAllowed(true);
    cmd.parseArgs("--x-y=123");
    assertEquals(123, bean.x);
}

The above test should pass but as of picocli 4.5.1, it fails with error UnmatchedArgumentException: Unknown option: '--x-y=123'.

@remkop
Copy link
Owner Author

remkop commented Oct 14, 2020

@metacosm Picocli 4.5.2, which contains the fix for this issue, has been released.
Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: parser An issue or change related to the parser type: bug 🐛
Projects
None yet
Development

No branches or pull requests

1 participant