Repository navigation
Accept --key value for long options that take a value - #25
clockblocker wants to merge 1 commit into
Conversation
11074d2 to
8f29c8d
Compare
5f5bda8 to
55507ad
Compare
ebe522c to
c171f71
Compare
1746917 to
87a9246
Compare
576b6a2 to
64bb06b
Compare
2952591 to
d953832
Compare
64bb06b to
ca12ff5
Compare
With the new processor rfl::cli::SeparateOptionValues, rfl::cli::read takes the value of a long option from the next token when it is given without '=': `--sql "SELECT 1"`. The next token is taken unless it looks like an option; if there is none, parsing fails with "Missing value for option '--sql'.". Bool flags, variants, rfl::Generic and unknown options never take the next token. Without the processor nothing changes: a long option takes its value only after '='. The public parse_argv, which has no option table, is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ca12ff5 to
c286ad9
Compare
d953832 to
6234e78
Compare
|
AI-drafted: question for the maintainer on fork PR #25 ("Accept
Making it the default would change three inputs that parse on main (with
Would you like |
Summary
Adds the opt-in
rfl::cli::SeparateOptionValuesprocessor so long options can take their value from the next argument (--sql "SELECT 1"), without changing defaultrfl::cli::readbehavior.Example
main)SeparateOptionValues--name in.txtname="",input="in.txt"name="in.txt",input=nullopt--name --verbosename="",verbose=trueMissing value for option '--name'.in.txt --namename="",input="in.txt"Missing value for option '--name'.--offset -5offset="",input="-5"offset=-5Key details
-not followed by a digit or.).--name=still passes"".rfl::Generic, and unknown options never consume the next token (--verbose 0leaves0positional).--labels.env prod), and wrappers. Publicparse_argvis unchanged.cli.md("Long options").Open question: keep
SeparateOptionValuesopt-in (likerfl::EnumNamesOnlyin munich-data-engineering#718), or make--key valuethe default with an opt-out processor?AI-authored. Depends on: #22, #34.