-
Notifications
You must be signed in to change notification settings - Fork 53
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
Repeated options (-vvv) don't give a count value #40
Comments
Also works that way too (tough I would have say it is not normal single letter option definition):
could you share a shell script which produces the bug please? |
oh, I got it. Sorry I replied a bit faster. It's the extra
which gives:
That one is interesting.
Something related to docopt/docopt#386 that brings inconsistency behavior, and is bugged it the main docopt-go too. I really want to fix this ugly one, I need to fix it in the lib. It will introduce a behavior change, for those using the result. I've done some more tests and the behavior also changes when Need a great work on that. |
So @rdonkin, before fighting for a better world, here is a work around for tomorrow:
or even more verbosely: 😉
drum roll...
now, that said, I have a question: If It's a real serious question as I'm working on the parser to provide helpful, descriptive error messages. This bug details for curious reader: In this corner case, we are facing a behavior which is confusing. This behavior is not part of When you don't use the |
Thanks @Sylvain303 - that worked well. It would be nice if the syntax could remain confined to the Options section, as it's quite long. Not sure if having a 2nd line in Usage is possible, or defines mutually exclusive sets of options. Perhaps a good solution would be if Not sure about the parser error, it's probably OK if it's fairly technical with enough detail and request to submit a GitHub issue (if this is to flag up issues). |
This part is native docopt syntax: Usage: describe the valid usage available via the docopt language. Of course many line of Usage are possible and define the program's validation CLI provided by the docopt parser, but you may may speak about splitting one definition on multiple lines. The short version is
There is one:
everything in docopt can use this repeatability even groups.
You may be right, the example could be more useful, the doc is spread on many locations. This point may be improved.
I'm not sure to understand this part of the message. In this particular issue, you are hitting some weakness of docopt actual implementation and documentation. Your attempt was almost good. As I'm trying to improve the feedback of using docopt through Thanks for your feedback, you can close the issue, if its resolved for you. I will open a new one the correcting the docopt lib behavior we are facing in that context. |
I was trying to get repeated
-v
arguments working to increase level of verbosity (as used by ssh, rsync, ansible, etc).This seems to be supported by docopt, based on this try.docopt.org test, giving a value of
2
for thev
option in output - but the example below doesn't work indocopt/docopts
0.6.3:Any use of
-vv
for example gives a usage error.I am currently having to use options like
--v3
as a workaround. Using--v=3
would be OK but not as pleasant for the user as repeating-v
to get more verbose.Any suggestions on how to do this?
The text was updated successfully, but these errors were encountered: