docopts.sh has been publised as a docopts
companion its documentation live here:
docs/README.md.
It offer some API alternatives and allow to build external wrapper.
- use verb for action
- stop using
-h
<msg>
for reading help - keep compatibily with old syntax trough a new verb:
compat
- introduce more useful error message
Usage:
docopts [options] parse USAGE : [<argv>...]
docopts [options] parse [--no-declare] -A <name> USAGE : [<argv>...]
docopts [options] parse -G <prefix> USAGE : [<argv>...]
Example:
docopts parse "$USAGE" : <option passed here>
-h
still available trough compat
docopts compat -h "$USAGE" : <option passed here>
generate usage completion (as kubect completion
done by cobra)
docopts completion "$usage"
Usage:
docopts debug [--explain-parsed] USAGE : [<argv>...]
docopts debug [--show-argument-match] USAGE : [<argv>...]
Usage:
docopts generate USAGE
docopts generate -f FILENAME
old API_proposal.md