Repository navigation
Accept abbreviated long options in rfl::cli - #27
Open
clockblocker wants to merge 1 commit into
Open
clockblocker wants to merge 1 commit into
clockblocker wants to merge 1 commit into
Conversation
clockblocker
force-pushed
the
cli-abbreviated-long-options
branch
from
November 14, 2026 13:01
911a3b7 to
f9cf5e3
Compare
clockblocker
force-pushed
the
wave-base-5
branch
from
November 14, 2026 13:01
06b7ba6 to
ebe522c
Compare
clockblocker
force-pushed
the
cli-abbreviated-long-options
branch
2 times, most recently
from
November 16, 2026 05:18
9e31055 to
7a50cf9
Compare
clockblocker
force-pushed
the
wave-base-7
branch
from
November 17, 2026 04:18
049151c to
ce84e34
Compare
clockblocker
force-pushed
the
cli-abbreviated-long-options
branch
3 times, most recently
from
November 17, 2026 07:15
faa3a7c to
dbaccb7
Compare
With the new rfl::cli::AllowAbbreviations processor, a long option that matches no field stands for the one long option it is a prefix of, so `--rep` is `--report`. Only the last part of a dotted name is shortened (`--database.h`, not `--data`). An exact match wins, and a prefix of several options fails with "Option '--for' is ambiguous; possibilities: '--force-export', '--format'." Short options, map keys and rfl::ExtraFields keys are never abbreviated. This is opt-in, like rfl::AllowRawPtrs. Without AllowAbbreviations, rfl::cli::read behaves as before: a long option that is a prefix of another is ignored, or rejected with rfl::NoExtraFields. Co-Authored-By: Claude Opus 5.5 <[email protected]>
clockblocker
force-pushed
the
wave-base-7
branch
from
November 17, 2026 09:34
385e359 to
417c86b
Compare
clockblocker
force-pushed
the
cli-abbreviated-long-options
branch
from
November 17, 2026 09:34
dbaccb7 to
c54cfc2
Compare
This was referenced Nov 21, 2026
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
Adds the opt-in
rfl::cli::AllowAbbreviationsprocessor so unambiguous prefixes of long options resolve automatically (e.g.--verb→--verbose), without changing defaultrfl::cli::readbehavior.Example
Key details
--database.h, not--data.host); map keys,rfl::ExtraFieldskeys, and short options are never abbreviated.rfl::NoExtraFields,rfl::cli::SeparateOptionValues, and the two-stepparse_argv+resolve_argsAPI. Ignored by non-CLI formats.cli.md("Abbreviated long options").Open question: keep opt-in (
rfl::cli::AllowAbbreviations) or enable by default (like getopt_long/argparse)?AI-authored. Depends on: #25.