Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Repeated mutually exclusive args give nested lists... sometimes. #56

jkleint opened this Issue Oct 4, 2012 · 5 comments


None yet
2 participants

jkleint commented Oct 4, 2012

Docopt is really cool. It fits the way I write tools; I like.

I'm trying to express "at least one arg from each of two sets". I think I can do this with repeated "mutually exclusive" args:

Usage:  foo (--x=x|--y=y)... (--a=a|--b=b)...

But, with docopt 0.5.0 and git fce1ee7, I run into a slight issue:

docopt("Usage:  foo (--x=x|--y=y)...", "--x=1 --y=2")
{'--x': ['1'],
 '--y': [['2']]}

I believe it should be:

{'--x': ['1'],
 '--y': ['2']}

And If there's a better way of achieving my goal, I'm all ears.


keleshev commented Oct 4, 2012

Thanks for reporting—I'm investigating.

@keleshev keleshev closed this in 6ed515d Oct 4, 2012


keleshev commented Oct 4, 2012

This fixes against the test-case that you provided.

Is it critical for you to have the fix on PyPI, or is it ok that I will release it to PyPI when all the changes for 0.6.0 are done (sometime this month)?

@keleshev keleshev reopened this Oct 4, 2012


keleshev commented Oct 4, 2012

(I reopen this—didn't expect that commit message "Fix #56" will close the issue :-)

jkleint commented Oct 6, 2012

It is not critical. Thank you!


keleshev commented Jan 23, 2013

This fix is now incorporated into the latest release (0.6.0).

@keleshev keleshev closed this Jan 23, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment