epage / clapng

A full featured, fast Command Line Argument Parser for Rust
docs.rs/clap
Apache License 2.0
0 stars 0 forks source link

Support alternative name/value separator #239

Open epage opened 2 years ago

epage commented 2 years ago

Issue by epage Monday Nov 15, 2021 at 14:52 GMT Originally opened as https://github.com/clap-rs/clap/issues/3026


Please complete the following tasks

Clap Version

master

Describe your use case

A part of supporting non-unix syntax (#2468) is supporting a custom name/value separator.

Example:

icacls <filename> [/grant[:r] <sid>:<perm>[...]] [/deny <sid>:<perm>[...]] [/remove[:g|:d]] <sid>[...]] [/t] [/c] [/l] [/q] [/setintegritylevel <Level>:<policy>[...]]

Describe the solution you'd like

  1. Come up with a name for this separator
  2. Add a use_<name>, requires_<name>, and <name>_delimiter like use_delimiter, requires_delimiter, and value_delimiter
  3. Deprecated requires_equals in favor of requires_<name> (especially since it references a specific syntax)
  4. Rename use_delimiter to use_value_delimiter and requires_delimiter to requires_value_delimiter to disambiguate

Alternatives, if applicable

No response

Additional Context

No response

epage commented 2 years ago

Comment by mkayaalp Friday Nov 19, 2021 at 06:20 GMT


  1. Come up with a name for this separator

I don't think we'll be able to come up with anything that does not include the word "separator" in it and calling it simply the separator would be no better than calling the other one simply the delimiter. So, I think you got in the title. I vote name_value_separator. It does separate the name and the value from each other after all.

  1. Rename use_delimiter to use_value_delimiter and requires_delimiter to requires_value_delimiter to disambiguate

Agreed. It parallels value_terminator.