switch to docopt-ng, the maintained fork of docopt

This commit is contained in:
Jack O'Connor 2024-12-04 10:25:16 -08:00
parent ba18166c75
commit 9dffa38037
2 changed files with 6 additions and 3 deletions

View File

@ -316,7 +316,7 @@ def merged_args_dicts(global_args, subcommand_args):
def docopt_parse_args(argv):
args = docopt.docopt(__doc__, argv, help=False, options_first=True)
args = docopt.docopt(__doc__, argv, default_help=False, options_first=True)
command = args['<command>']
# Skip further parsing for cases like `peru badcommand` (because there is
# no docopt), `peru help <cmd>` (because help is a fake command also with
@ -325,7 +325,10 @@ def docopt_parse_args(argv):
if command in COMMAND_DOCS and not args['--help']:
command_doc = COMMAND_DOCS[command]
command_argv = [command] + args['<args>']
command_args = docopt.docopt(command_doc, command_argv, help=False)
command_args = docopt.docopt(
command_doc,
command_argv,
default_help=False)
args = merged_args_dicts(args, command_args)
return args

View File

@ -34,7 +34,7 @@ def get_all_resources_filepaths():
def get_install_requires():
dependencies = ['docopt', 'PyYAML']
dependencies = ['docopt-ng', 'PyYAML']
if sys.version_info < (3, 5):
raise RuntimeError('The minimum supported Python version is 3.5.')
return dependencies