77
88from typing import (Any , AnyStr , Dict , List , Sequence , Text , Union , cast )
99
10+ from . import loghandler
1011from schema_salad .ref_resolver import file_uri
1112from .process import (Process , shortname )
1213from .resolver import ga4gh_tool_registries
1314from .software_requirements import (SOFTWARE_REQUIREMENTS_ENABLED )
1415
1516_logger = logging .getLogger ("cwltool" )
1617
17- defaultStreamHandler = logging .StreamHandler ()
18- _logger .addHandler (defaultStreamHandler )
19- _logger .setLevel (logging .INFO )
18+ DEFAULT_TMP_PREFIX = "tmp"
2019
2120
2221def arg_parser (): # type: () -> argparse.ArgumentParser
@@ -28,7 +27,10 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
2827 parser .add_argument ("--no-container" , action = "store_false" , default = True ,
2928 help = "Do not execute jobs in a Docker container, even when specified by the CommandLineTool" ,
3029 dest = "use_container" )
31-
30+ parser .add_argument ("--parallel" , action = "store_true" , default = False ,
31+ help = "[experimental] Run jobs in parallel. "
32+ "Does not currently keep track of ResourceRequirements like the number of cores"
33+ "or memory and can overload this system" )
3234 parser .add_argument ("--preserve-environment" , type = Text , action = "append" ,
3335 help = "Preserve specific environment variable when running CommandLineTools. May be provided multiple times." ,
3436 metavar = "ENVVAR" ,
@@ -49,14 +51,35 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
4951 default = True , help = "Do not delete Docker container used by jobs after they exit" ,
5052 dest = "rm_container" )
5153
54+ cidgroup = parser .add_argument_group ("Options for recording the Docker "
55+ "container identifier into a file" )
56+ cidgroup .add_argument ("--record-container-id" , action = "store_true" ,
57+ default = False ,
58+ help = "If enabled, store the Docker container ID into a file. "
59+ "See --cidfile-dir to specify the directory." ,
60+ dest = "record_container_id" )
61+
62+ cidgroup .add_argument ("--cidfile-dir" , type = Text ,
63+ help = "Directory for storing the Docker container ID file. "
64+ "The default is the current directory" ,
65+ default = "" ,
66+ dest = "cidfile_dir" )
67+
68+ cidgroup .add_argument ("--cidfile-prefix" , type = Text ,
69+ help = "Specify a prefix to the container ID filename. "
70+ "Final file name will be followed by a timestamp. "
71+ "The default is no prefix." ,
72+ default = "" ,
73+ dest = "cidfile_prefix" )
74+
5275 parser .add_argument ("--tmpdir-prefix" , type = Text ,
5376 help = "Path prefix for temporary directories" ,
54- default = "tmp" )
77+ default = DEFAULT_TMP_PREFIX )
5578
5679 exgroup = parser .add_mutually_exclusive_group ()
5780 exgroup .add_argument ("--tmp-outdir-prefix" , type = Text ,
5881 help = "Path prefix for intermediate output directories" ,
59- default = "tmp" )
82+ default = DEFAULT_TMP_PREFIX )
6083
6184 exgroup .add_argument ("--cachedir" , type = Text , default = "" ,
6285 help = "Directory to cache intermediate workflow outputs to avoid recomputing steps." )
@@ -120,13 +143,16 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
120143 default = True , dest = "strict" )
121144
122145 parser .add_argument ("--skip-schemas" , action = "store_true" ,
123- help = "Skip loading of schemas" , default = True , dest = "skip_schemas" )
146+ help = "Skip loading of schemas" , default = False , dest = "skip_schemas" )
124147
125148 exgroup = parser .add_mutually_exclusive_group ()
126149 exgroup .add_argument ("--verbose" , action = "store_true" , help = "Default logging" )
127150 exgroup .add_argument ("--quiet" , action = "store_true" , help = "Only print warnings and errors." )
128151 exgroup .add_argument ("--debug" , action = "store_true" , help = "Print even more logging" )
129152
153+ parser .add_argument ("--timestamps" , action = "store_true" , help = "Add "
154+ "timestamps to the errors, warnings, and "
155+ "notifications." )
130156 parser .add_argument ("--js-console" , action = "store_true" , help = "Enable javascript console output" )
131157 parser .add_argument ("--user-space-docker-cmd" ,
132158 help = "(Linux/OS X only) Specify a user space docker "
@@ -166,7 +192,7 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
166192 parser .add_argument ("--default-container" ,
167193 help = "Specify a default docker container that will be used if the workflow fails to specify one." )
168194 parser .add_argument ("--no-match-user" , action = "store_true" ,
169- help = "Disable passing the current uid to ' docker run --user`" )
195+ help = "Disable passing the current uid to ` docker run --user`" )
170196 parser .add_argument ("--disable-net" , action = "store_true" ,
171197 help = "Use docker's default networking for containers;"
172198 " the default is to enable networking." )
@@ -370,4 +396,4 @@ def generate_parser(toolparser, tool, namemap, records):
370396 default = inp .get ("default" , None )
371397 add_argument (toolparser , name , inptype , records , description , default )
372398
373- return toolparser
399+ return toolparser
0 commit comments