args icon indicating copy to clipboard operation
args copied to clipboard

question mark doesn't work?

Open nohkumado opened this issue 4 years ago • 3 comments

Hello!

i tryed adding a flag for help final parser = ArgParser() ..addFlag('help', abbr: '?', defaultsTo: false, help: "Help about the options")

but when using --help it works, with -? it lands into the rest part and isn't parsed? my fault? or is something else wrong?

nohkumado avatar Sep 20 '21 12:09 nohkumado

It looks like only upper/lower case letters and digits are allowed.

We should probably validate this when constructing options though so that we can fail earlier and more directly point you at the problem?

This general rule for allowable names seems to likely come from guideline 2 here? https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02

jakemac53 avatar Sep 27 '21 19:09 jakemac53

hmm... but usually on the command line the '?' is a fairly often used shortcut for help? but oh well... ok.... but yes a warning, "not allowed string" would be nice, a silent failing and then the non-functioning of the argument isn't pointing in the right direction....

nohkumado avatar Sep 28 '21 08:09 nohkumado

It looks like only upper/lower case letters and digits are allowed.

Where is this done? There's an _invalidChars check, but that seems to check only for whitespace, quotation characters, and slashes. It also looks like there's an appropriate error message thrown if one of those characers is used.

This general rule for allowable names seems to likely come from guideline 2 here? https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02

Those are guidelines, not rules, and it also would be wrong if they're applied to non-POSIX systems.

jamesderlin avatar May 25 '22 16:05 jamesderlin