Skip to content

Use locale-independent normalization for case-insensitive option matching - #614

Merged
mkarg merged 4 commits into
masterfrom
copilot/fix-issue-612-case-insensitive-option-matching
Sep 20, 2026
Merged

mkarg merged 4 commits into
masterfrom
copilot/fix-issue-612-case-insensitive-option-matching

Conversation

Copilot AI commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Case-insensitive option matching depended on the JVM default locale, which breaks under Turkish locales where ASCII I lowercases to ı. That affected both direct option lookup and abbreviated matching, and could cause variable-arity options to consume what should have been a following named option.

  • Root cause

    • Case-insensitive option names were normalized with the default locale in the parser and fuzzy lookup paths.
    • Under tr-TR, --INPUT no longer normalized to the same key as --input.
  • Parser changes

    • Centralized lowercase normalization on Locale.ROOT for protocol-style option names.
    • Applied the same normalization consistently in:
      • exact option-name matching
      • prefix matching used by named-option detection
      • abbreviated-option lookup in FuzzyMap
  • Regression coverage

    • Added Turkish-locale tests for:
      • --INPUT matching --input when case-sensitive options are disabled
      • abbreviated matching (for example --INP) under the same locale
      • a variable-arity parse where the following option/value pair must not be silently consumed
    • Consolidated locale-mutating tests behind a shared helper so default-locale changes are serialized and restored safely
public static String toLowerCase(String s) {
    return s.toLowerCase(Locale.ROOT);
}

Copilot AI and others added 3 commits September 20, 2026 12:18
Co-authored-by: mkarg <1701815+mkarg@users.noreply.github.com>
Co-authored-by: mkarg <1701815+mkarg@users.noreply.github.com>
Co-authored-by: mkarg <1701815+mkarg@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue #612 for case-insensitive option matching Use locale-independent normalization for case-insensitive option matching Sep 20, 2026
Copilot AI requested a review from mkarg September 20, 2026 12:22
@mkarg
mkarg marked this pull request as ready for review September 20, 2026 12:45
@mkarg
mkarg merged commit 0b5bfde into master Sep 20, 2026
2 checks passed
@mkarg
mkarg deleted the copilot/fix-issue-612-case-insensitive-option-matching branch September 20, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants