|
1 | 1 | #!/usr/bin/env python3
|
2 | 2 | """Entry point for cwltool."""
|
3 | 3 |
|
| 4 | +import argcomplete |
4 | 5 | import argparse
|
5 | 6 | import functools
|
6 | 7 | import io
|
|
100 | 101 | windows_default_container_id,
|
101 | 102 | )
|
102 | 103 | from .workflow import Workflow
|
103 |
| - |
| 104 | +# PYTHON_ARGCOMPLETE_OK |
104 | 105 |
|
105 | 106 | def _terminate_processes() -> None:
|
106 | 107 | """Kill all spawned processes.
|
@@ -396,7 +397,7 @@ def init_job_order(
|
396 | 397 | k: v for k, v in cmd_line.items() if k.startswith(record_name)
|
397 | 398 | }
|
398 | 399 | for key, value in record_items.items():
|
399 |
| - record[key[len(record_name) + 1 :]] = value |
| 400 | + record[key[len(record_name) + 1:]] = value |
400 | 401 | del cmd_line[key]
|
401 | 402 | cmd_line[str(record_name)] = record
|
402 | 403 | if "job_order" in cmd_line and cmd_line["job_order"]:
|
@@ -854,7 +855,9 @@ def main(
|
854 | 855 | addl = [] # type: List[str]
|
855 | 856 | if "CWLTOOL_OPTIONS" in os.environ:
|
856 | 857 | addl = os.environ["CWLTOOL_OPTIONS"].split(" ")
|
857 |
| - args = arg_parser().parse_args(addl + argsl) |
| 858 | + parser = arg_parser() |
| 859 | + argcomplete.autocomplete(parser) |
| 860 | + args = parser.parse_args(addl + argsl) |
858 | 861 | if args.record_container_id:
|
859 | 862 | if not args.cidfile_dir:
|
860 | 863 | args.cidfile_dir = os.getcwd()
|
@@ -895,7 +898,7 @@ def main(
|
895 | 898 | args.workflow = "CWLFile"
|
896 | 899 | else:
|
897 | 900 | _logger.error("CWL document required, no input file was provided")
|
898 |
| - arg_parser().print_help() |
| 901 | + parser.print_help() |
899 | 902 | return 1
|
900 | 903 | if args.relax_path_checks:
|
901 | 904 | command_line_tool.ACCEPTLIST_RE = command_line_tool.ACCEPTLIST_EN_RELAXED_RE
|
|
0 commit comments