0

I have a simple python script that uses docopt to parse command line arguments. It looks like this:

#!/usr/bin/env python

__doc__ = """
Usage: mycopy <src>... <dest>
"""
from docopt import docopt

options = docopt(__doc__)

When I run it:

./mycopy source1/ source2/ destination/

it just prints the usage info, meaning that the command line arguments I passed it were wrong. Is something wrong with the usage spec? Is it even possible to do something like this using docopt?

Dan Keder
  • 684
  • 5
  • 8

1 Answers1

0

If you put <dest> before <src>..., it works. Accordingly, run it with ./mycopy destination/ source1/ source2/.

I think the docopt hasn't implemented the support for: ARGS... ARG. This case adds some complexity to the implementation. But I agree 'copy src1 src2 ... dest' is more straightforward usage. So maybe you could raise a request to this project: https://github.com/docopt/docopt

ZZY
  • 3,689
  • 19
  • 22
  • Thank you for responding. I created a new issue for this on github: https://github.com/docopt/docopt/issues/190 – Dan Keder May 23 '14 at 15:20