docopt-ng
docopt-ng copied to clipboard
ability to declare long parameters using just a single `-`, e.g. `-Ssendwait`
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]