Skip to content

Conversation

@zefir-git
Copy link
Contributor

This PR improves the clarity of argument parser messages when a boolean flag is incorrectly provided with a value using =.

Previously, cases like -f=val or --flag=value would produce misleading messages such as ‘unknown option '-f'’ even if the flag exists. Now, the parser reports more precise messages:

  • unexpected '=' for option '-f'
  • unexpected '=' for option '--flag'
  • unexpected '=' in combined short options '-ff'

This PR improves the clarity of argument parser messages when a boolean
flag is incorrectly provided with a value using `=`.

Previously, cases like `-f=val` or `--flag=value` would produce
misleading messages such as ‘unknown option '-f'’ even if the flag
exists. Now, the parser reports more precise messages:

- `unexpected '=' for option '-f'`
- `unexpected '=' for option '--flag'`
- `unexpected '=' in combined short options '-ff'`
@zefir-git zefir-git self-assigned this Nov 26, 2025
@zefir-git zefir-git added fix Fixes a bug semver:patch Backward compatible fixes labels Nov 26, 2025
@zefir-git zefir-git changed the title Refine parser error messages for flags given = values Refined parser error messages for flags given = values Nov 26, 2025
@zefir-git zefir-git merged commit fd50788 into main Nov 26, 2025
1 check passed
@zefir-git zefir-git deleted the improve-flag-equals-val-errors branch November 26, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fixes a bug semver:patch Backward compatible fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants