The GitHub Actions job "CodeQL" on commons-cli.git/master has succeeded. Run started by GitHub user garydgregory (triggered by garydgregory).
Head commit for run: df669bd47f1be804af1843b24c1152a6cd1b0a8e / Andrea Cosentino <[email protected]> Test how '!' marks a required option in PatternOptionBuilder (#449) * Fix PatternOptionBuilder '!' marking the wrong option as required The Javadoc says '!' goes in front of a mandatory option, and its own example, "vp:!f/", is meant to make -f required. The flag was only applied once the next option character was read, so it ended up on the option before the '!': the example made -p required and left -f optional. It only worked when '!' was the first character of the pattern, which is the one case the tests covered. Now '!' applies to the option that follows it. A '!' with no option after it, as in "a:b!", used to land on the previous option; it now throws IllegalArgumentException, so a pattern written against the old behavior fails right away instead of quietly losing its required option. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Keep the '!' behavior in PatternOptionBuilder and test it The earlier commit on this branch made '!' mark the option after it, following the 2008 Javadoc sentence "The exclamation mark precede a mandatory option". CLI-55 has the intent the other way round: "hc!<" makes -c mandatory, so '!' marks the option before it, which is what the code has always done and what the Javadoc now says. Back out that change so existing patterns keep working, and add tests for the current behavior instead: the Javadoc example, the CLI-55 example, a trailing '!' and several '!' in one pattern. Also say that a '!' at the start of the pattern marks the first option. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Andrea Cosentino <[email protected]> --------- Signed-off-by: Andrea Cosentino <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Gary Gregory <[email protected]> Report URL: https://github.com/apache/commons-cli/actions/runs/41038707587 With regards, GitHub Actions via GitBox
