-
-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Hi,
First and foremost, thank you for this fantastic project! While there are others out there, I really like this one since it's small, light, simple, and very flexible.
I am having trouble with negative values:
# cmd <offset> --reduce
$ cmd -20 --reduce -4 # fails as it parses -20 to -2 -0 and -4 as an option name.Usually, in some CLI programs, something like this would be evaluated correctly:
$ cmd "-20" --reduce "-4" # same issue
$ cmd "-20" --reduce=-4 # this one partially works It seems that currently, php-cli doesn't support direct negative values unless I'm missing something (please correct me if I'm wrong).
I modified the Normalizer and the Parser to support that if this is truly an issue let me know, and I can create a pull request.
Also, as an artifact, now a syntax as follows is easily implemented:
# cmd <name> [counted...] --variadic [values...] --another <values...>
$ cmd john [12 45 87] --variadic [ 15 20 65 ] --another 98 65 45
# Square brackets act like group boundaries for "in the middle" variadic arguments.
# Still the last variadic argument, without square brackets, functions as normal.I think it's Cool... and very useful.
Let me know if that's an acceptable improvement
adhocore
Metadata
Metadata
Assignees
Labels
No labels