jmathai / elodie

An EXIF-based photo assistant, organizer and workflow automation tool.
https://bit.ly/introducing-elodie
Apache License 2.0
1.27k stars 139 forks source link

docopt issue when running elodie.py #79

Closed arikfr closed 8 years ago

arikfr commented 8 years ago

I've tried running the following command:

$ ./elodie.py import --source="/Users/arik/Pictures/Incoming" --destination="/Users/arik/Pictures/2016"

But got the following error:

Traceback (most recent call last):
  File "./elodie.py", line 217, in <module>
    sys.exit(main())
  File "./elodie.py", line 208, in main
    params = docopt(usage())
  File "/usr/local/lib/python2.7/site-packages/docopt.py", line 451, in docopt
    formal_pattern = parse_pattern(formal_usage(usage), options=pot_options)
  File "/usr/local/lib/python2.7/site-packages/docopt.py", line 334, in parse_pattern
    result = parse_expr(tokens, options)
  File "/usr/local/lib/python2.7/site-packages/docopt.py", line 350, in parse_expr
    seq = parse_seq(tokens, options)
  File "/usr/local/lib/python2.7/site-packages/docopt.py", line 360, in parse_seq
    atom = parse_atom(tokens, options)
  File "/usr/local/lib/python2.7/site-packages/docopt.py", line 386, in parse_atom
    result = [Optional(*parse_expr(tokens, options))]
  File "/usr/local/lib/python2.7/site-packages/docopt.py", line 342, in parse_expr
    seq = parse_seq(tokens, options)
  File "/usr/local/lib/python2.7/site-packages/docopt.py", line 360, in parse_seq
    atom = parse_atom(tokens, options)
  File "/usr/local/lib/python2.7/site-packages/docopt.py", line 391, in parse_atom
    return parse_long(tokens, options)
  File "/usr/local/lib/python2.7/site-packages/docopt.py", line 293, in parse_long
    raise tokens.error('%s must not have an argument' % opt.name)
docopt.DocoptLanguageError: --album-from-folder must not have an argument

After some debugging I noticed that the value it think it gets is <a>, which made me realize that for some reason --album-from-folder gets the value of --album. Once I changed the --album option name to --zalbum it worked.

My docopt version is 0.4.0.

Anyone else had this issue?

Personally, I recommend moving from docopt to click -- far more predictable and stable.

noonat commented 8 years ago

The import command is picking up the option name from the update command? Whoa, that's bizarre! I have a branch I am working on now that adds tests for the different commands, but I can't seem to reproduce that behavior there.

Also a fan of click! I would be happy to convert the code to using it, if @jmathai wants to.

jmathai commented 8 years ago

@noonat @arikfr can the interface for commands to elodie.py remain the same with click? If so, then I'm okay with it.