Skip to content
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

Platform specfic parse issues #5

Open
editasmed opened this issue Jun 19, 2015 · 4 comments
Open

Platform specfic parse issues #5

editasmed opened this issue Jun 19, 2015 · 4 comments

Comments

@editasmed
Copy link

Hi ,

I have a docopt string like

"""Get PAM list
Usage:
list_vals_for_prot_sp.py <length_guide> <sense|antisense|all> [--chrom=CHROM_NUM default is all]
Options:
-h --help Show this screen.
"""

This parses a command like the one given below on MacOSX running 2.7.6 and docopt 0.6.1 just fine. It fails completely and just shows me the help text on Ubuntu also running Python 2.7.6 and docopt 0.6.1. Everything is identical and I am wondering why the parser behavior changes between Linux and MacOSX.

python list_vals_for_prot_sp.py 22 all

Parses file : python 2.7.6 OSX
Fails to parse : python 2.7.6 OSX

Thanks

@keleshev
Copy link
Member

I suspect that at least one version of docopt that you are using is a pre-release version. Please submit md5 hashes of docopt.py file on both systems. On OS X you can use the built-in md5 utility. On Linux there's something else, I think it's called md5sum, but I might be wrong.

@keleshev
Copy link
Member

Anyway, you need an empty line between usage-section and options-section. I suspect that that can fix it.

@editasmed
Copy link
Author

For some reason the empty line did not fix it . The OSX and Linux "versions" had different checksums . I ended up uninstalling the failing Linux version and installing the OSX version in Linux. Its all working after that. Incidentally the test case also fails on the web version at try.docopt.org. I was wondering if it is possible to have a debug option so I know where the parse is failing.

@keleshev
Copy link
Member

This works: http://try.docopt.org/?doc=Get+PAM+list%0D%0AUsage%3A%0D%0Alist_vals_for_prot_sp.py+%5B--chrom%3DCHROM_NUM+default+is+all%5D%0D%0A%0D%0AOptions%3A%0D%0A-h+--help+Show+this+screen.&argv=default+is+all+--chrom%3DFOO

Note that default is all are treated rightly as optional commands.

For the next release–debugability is the priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants