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

ability to declare long parameters using just a single -, e.g. -Ssendwait #69

Open
FelixSchwarz opened this issue Aug 8, 2024 · 0 comments

Comments

@FelixSchwarz
Copy link

Some Unix commands have longer parameter names which just start with a single dash, e.g. -Ssendwait. argparse can handle these parameters but I'm unable to do this with docopt-ng:

#!/usr/bin/env python3
"""
Usage:
  foo [options]

Options:
  -Ssendwait     wait until request was sent
  -Snosendwait   return immediately
"""

from docopt import docopt
arguments = docopt(__doc__)
print(arguments)
$ ./parse-docopt.py -Snosendwait
Warning: found unmatched (duplicate?) arguments [Option('-S', None, 0, True), Option('-n', None, 0, True), Option('-o', None, 0, True), Option('-s', None, 0, True), Option('-e', None, 0, True), Option('-n', None, 0, True), Option('-d', None, 0, True), Option('-w', None, 0, True), Option('-a', None, 0, True), Option('-i', None, 0, True), Option('-t', None, 0, True)]
Usage:
  foo [options]
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

1 participant