-
Notifications
You must be signed in to change notification settings - Fork 23
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
add support for docopt style help #56
Comments
It is nice idea, I looked at docopt some time ago, but I don't use docopt myself. Do you use it in your projects? |
I try to but I fail a lot :D. It seems to be the only well defined specification for writing help texts that i can find so everytime i need to write help i end up looking at docopt Perhaps i will try to make a pull request, i was wanting to learn go for a while now anyways... |
PRs are welcome :) Here is list of supported parsers: https://github.com/dim-an/cod/blob/master/parse_doc/parse_help.go#L30-L33 Last one is default parser that parses everything. Special parsers go before default parser (right now we only have argparse parser). They return error if they think that they don't support current help text. Line 52 in de10c9b
You can get inspiration from argparse parser and its test. Line 318 in de10c9b
https://github.com/dim-an/cod/blob/de10c9bfff394dd59f302515776f1413f26e5a49/parse_doc/argparse_test.go |
It would be nice if cod could learn help in the format proposed by docopt http://docopt.org/
for example if i try to make cod learn their default example:
Only flag options are learned. However I'm not sure how wildly spread the docopt format actually is...
The text was updated successfully, but these errors were encountered: