-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Negative number as positional argument with "options_first" #158
Comments
I would suggest to use commands instead of your options:
Now |
Yes I know commands are better here. But usage is given and can't be changed. Regardless of my example there are plenty of valid examples that should work IMO, e.g.:
It is possible to change behavior of |
The general solution is to use To make
|
Thanks for your suggestions but I didn't open this issue only for solving my particular problem. Maybe this should be considered being a bug. Especially with |
Do you have any specific proposal on how docopt should treat it? I thought that |
As I said before: unknown option should be passed as positional argument. For example: Or do you think there is any usage pattern where it doesn't make sense? |
In this case if user mistypes |
IMHO example similar with
If user mistypes |
@keleshev Is it possible to simply deactivate short options single dash for a specific command ? I believe in most cases we could be fine only using double dashes for options and then leaving single dash for negative numbers. |
Hi @halst, I read your solution for negative numbers as positionals in #93. But I think It doesn't work properly. I use
docopt
from master branch. Below are my test cases.py27 neg.py --triangle -1 2 3 4 5 6
py27 neg.py --asin -1
When I pass negative number as 2nd/3rd/... argument for
--triangle
everything works as I expect. Is there any solution (except for[--]
) for this?The text was updated successfully, but these errors were encountered: