Repository navigation
Report unknown long options by name under rfl::NoExtraFields in rfl::cli - #797
Open
clockblocker wants to merge 1 commit into
Open
clockblocker wants to merge 1 commit into
clockblocker wants to merge 1 commit into
Conversation
With rfl::NoExtraFields, `--nope=1` failed with "Value named 'nope' not used." and `--nope 1` with "Too many positional arguments: ...". The option table now lists every long option, through nested structs, maps and rfl::ExtraFields, so parse_argv rejects both with "Unknown option '--nope'.". Keys of maps and rfl::ExtraFields stay open; the fields of a struct inside a map are known (`--servers.eu.nope` is unknown). Without rfl::NoExtraFields, unknown long options are still ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clockblocker
marked this pull request as ready for review
November 25, 2026 08:45
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Under
rfl::NoExtraFields,rfl::cli::readrejects unknown long options by name (Unknown option '--...') instead of misreporting them as unused values or extra positional arguments.Example
rfl::NoExtraFields)main)--nope=1Value named 'nope' not used.Unknown option '--nope'.--nope 1 in.txtToo many positional arguments: expected at most 1, got 2.Unknown option '--nope'.--database.nope 1Too many positional arguments: expected at most 0, got 1.Unknown option '--database.nope'.--servers.eu.nope=1Found 2 errors: ...Unknown option '--servers.eu.nope'.Key details
rfl::ExtraFieldsinto the option table only whenrfl::NoExtraFieldsis active (no behavior change without it).rfl::ExtraFieldskeys stay open (--labels.env=prod), while fields of structs inside maps are checked (--servers.eu.nope=1).cli.md("Unknown options").AI-authored.