You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An alternative to using docopt-ng, or just docopt, may be docopt-dispatch. It makes it largely unnecessary to implement argument dispatching logic on your own and hence renders the Docopt CLI example source code more readable.
Example
"""Awesome CLI....Usage: awesome (-h | --help | --version) awesome login --user <user> --pass <pass>Commands: login Authorize a user with username and password"""fromdocopt_dispatchimportdispatchdefmain():
"""The CLI entrypoint."""dispatch(__doc__, version=__version__)
@dispatch.on("login")deflogin_command(**kwargs):
"""Authorize a user with username and password."""username=kwargs["user"]
password=kwargs["pass"]
...
An alternative to using docopt-ng, or just docopt, may be docopt-dispatch. It makes it largely unnecessary to implement argument dispatching logic on your own and hence renders the Docopt CLI example source code more readable.
Example
Related
The text was updated successfully, but these errors were encountered: