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

Keyword-only arguments without defaults are treated as positionals #13

Closed
evanunderscore opened this issue Jun 9, 2016 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@evanunderscore
Copy link
Collaborator

evanunderscore commented Jun 9, 2016

import defopt
def test(*, a):
    """:param str a: test"""
defopt.run(test, argv=['-h'])
usage: do.py [-h] a

positional arguments:
  a           test

optional arguments:
  -h, --help  show this help message and exit

This was an oversight, but my actual words from the documentation are "any optional arguments are converted to flags", so this is presently working as documented, even if not as intended. This means a fix should come with a major version bump.

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

No branches or pull requests

1 participant