Skip to content

Commit 00c2e98

Browse files
committed
cleanup of parameter descriptions, grouping
1 parent 75a939a commit 00c2e98

File tree

1 file changed

+32
-17
lines changed

1 file changed

+32
-17
lines changed

cwltool/argparser.py

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,25 @@
1919

2020

2121
def arg_parser(): # type: () -> argparse.ArgumentParser
22-
parser = argparse.ArgumentParser(description='Reference executor for Common Workflow Language')
22+
parser = argparse.ArgumentParser(
23+
description='Reference executor for Common Workflow Language standards.')
2324
parser.add_argument("--basedir", type=Text)
2425
parser.add_argument("--outdir", type=Text, default=os.path.abspath('.'),
2526
help="Output directory, default current directory")
2627

27-
parser.add_argument("--no-container", action="store_false", default=True,
28-
help="Do not execute jobs in a Docker container, even when specified by the CommandLineTool",
29-
dest="use_container")
3028
parser.add_argument("--parallel", action="store_true", default=False,
3129
help="[experimental] Run jobs in parallel. "
3230
"Does not currently keep track of ResourceRequirements like the number of cores"
3331
"or memory and can overload this system")
34-
parser.add_argument("--preserve-environment", type=Text, action="append",
35-
help="Preserve specific environment variable when running CommandLineTools. May be provided multiple times.",
36-
metavar="ENVVAR",
37-
default=["PATH"],
32+
envgroup = parser.add_mutually_exclusive_group()
33+
envgroup.add_argument("--preserve-environment", type=Text, action="append",
34+
help="Preserve specific environment variable when "
35+
"running CommandLineTools. May be provided multiple "
36+
"times.", metavar="ENVVAR", default=["PATH"],
3837
dest="preserve_environment")
39-
40-
parser.add_argument("--preserve-entire-environment", action="store_true",
41-
help="Preserve entire parent environment when running CommandLineTools.",
42-
default=False,
38+
envgroup.add_argument("--preserve-entire-environment", action="store_true",
39+
help="Preserve all environment variable when running "
40+
"CommandLineTools.", default=False,
4341
dest="preserve_entire_environment")
4442

4543
exgroup = parser.add_mutually_exclusive_group()
@@ -154,12 +152,22 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
154152
"timestamps to the errors, warnings, and "
155153
"notifications.")
156154
parser.add_argument("--js-console", action="store_true", help="Enable javascript console output")
157-
parser.add_argument("--user-space-docker-cmd",
155+
dockergroup = parser.add_mutually_exclusive_group()
156+
dockergroup.add_argument("--user-space-docker-cmd", metavar="CMD",
158157
help="(Linux/OS X only) Specify a user space docker "
159158
"command (like udocker or dx-docker) that will be "
160159
"used to call 'pull' and 'run'")
161-
parser.add_argument("--singularity", action="store_true", default=False,
162-
help="Use Singularity runtime for running containers")
160+
dockergroup.add_argument("--singularity", action="store_true",
161+
default=False, help="[experimental] Use "
162+
"Singularity runtime for running containers. "
163+
"Requires Singularity v2.3.2+ and Linux with kernel "
164+
"version v3.18+ or with overlayfs support "
165+
"backported.")
166+
dockergroup.add_argument("--no-container", action="store_false",
167+
default=True, help="Do not execute jobs in a "
168+
"Docker container, even when `DockerRequirement` "
169+
"is specified under `hints`.",
170+
dest="use_container")
163171

164172
dependency_resolvers_configuration_help = argparse.SUPPRESS
165173
dependencies_directory_help = argparse.SUPPRESS
@@ -239,8 +247,15 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
239247
parser.add_argument("--overrides", type=str,
240248
default=None, help="Read process requirement overrides from file.")
241249

242-
parser.add_argument("workflow", type=Text, nargs="?", default=None)
243-
parser.add_argument("job_order", nargs=argparse.REMAINDER)
250+
parser.add_argument("workflow", type=Text, nargs="?", default=None,
251+
metavar='cwl_document', help="path or URL to a CWL Workflow, "
252+
"CommandLineTool, or ExpressionTool. If the `inputs_object` has a "
253+
"`cwl:tool` field indicating the path or URL to the cwl_document, "
254+
" then the `workflow` argument is optional.")
255+
parser.add_argument("job_order",
256+
metavar='inputs_object', help="path or URL to a YAML or JSON "
257+
"formatted description of the required input values for the given "
258+
"`cwl_document`.")
244259

245260
return parser
246261

0 commit comments

Comments
 (0)