wibidata / odiago-common-flags

A Java command-line flag parsing library
6 stars 0 forks source link

The equals ('=') character should be optional #4

Open gwu opened 11 years ago

gwu commented 11 years ago

When specifying a flag like:

mycmd --flag=value

it would be nice if it also worked without the equals sign:

mycmd --flag value

kryzthov commented 11 years ago

Is there a specific use-case for this? I am concerned that boolean flags won't interact well with unparsed flags. "cmd --boolflag true" can be parsed as "mycmd --boolflag=true true" or "mycmd --boolflag=true"...

gwu commented 11 years ago

I'm proposing this change because I've noticed that users often try to use flags without the equals sign and it ends up causing frustration. If we can be more tolerant of user imprecision, it will just make people happier.

Is there some set of reasonable rules that we can come up with that resolve the parsing ambiguity that you've pointed out? For example, could we just make flags "greedy" for arguments?