Skip to content

Add LastValueWins, RequireEquals, multi-char Short, Sensitive argv masking, and occurrences log - #63

Closed
clockblocker wants to merge 1 commit into
cli-opt-and-read-detailedfrom
cli-parsing-modes-and-occurrences
Closed

clockblocker wants to merge 1 commit into
cli-opt-and-read-detailedfrom
cli-parsing-modes-and-occurrences

Conversation

@clockblocker

Copy link
Copy Markdown
Owner

Adds common GNU/CLI parsing modes and occurrence-order tracking:

  • rfl::cli::LastValueWins: lets repeated scalar options overwrite earlier occurrences (--out a --out b → "b")
  • rfl::cli::RequireEquals: requires --opt=value for value options (rejects bare --opt; takes precedence over SeparateOptionValues so presets compose cleanly)
  • Multi-character rfl::Short<"CC"> / rfl::Short<"rp"> single-dash options
  • rfl::cli::attr::Sensitive: overwrites sensitive option values in mutable char* argv[] in place with '*'
  • ReadResult<T>::occurrences: ordered vector of (canonical_long_name, value) pairs in exact argv order

Stacked on cli-opt-and-read-detailed (#62). Verified with ASan + UBSan across all CLI tests.

@clockblocker
clockblocker force-pushed the cli-parsing-modes-and-occurrences branch from 4eaa3ae to a89b5c2 Compare November 27, 2026 07:29
@clockblocker

Copy link
Copy Markdown
Owner Author

Closing mega-PR: attr::Sensitive is cut (const_cast UB, 0 uses); kept pieces (occurrences, LastValueWins, RequireEquals) will be split cleanly behind the Wave 4 RFC (branch preserved).

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.

1 participant