SamuelSchlesinger / commander-cli

A simple library I wrote to allow me to quickly and easily construct command line interfaces.
MIT License
29 stars 2 forks source link

option combined with value #25

Closed BebeSparkelSparkel closed 1 year ago

BebeSparkelSparkel commented 3 years ago

Some options are easier to use if the option is combined with the value like the sed option -i[extension].

Other CLIs use the assignment operator like HandBrakeCLI with the option -v, --verbose[=number] Be verbose (optional argument: logging level)

SamuelSchlesinger commented 3 years ago

Yeah, I guess the assignment operator could do the trick here. I feel similarly to this as I do to combined flags.

BebeSparkelSparkel commented 3 years ago

I don't want to limit it to an assignment operator. Just matching a prefix key to the value is what I would suggest.

optJoined @"prefix" would drop "prefix" from the text "prefix1234" and then try to unrender the remaining text "1234"

SamuelSchlesinger commented 3 years ago

Yeah, that's even better. PRs welcome, yet again!

BebeSparkelSparkel commented 3 years ago

I'll wait until you review the other PRs