Skip to content

Commit 4bdf072

Browse files
committed
Add --print-supported-versions option
1 parent 0eb42ff commit 4bdf072

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cwltool/main.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from .resolver import tool_resolver, ga4gh_tool_registries
3131
from .stdfsaccess import StdFsAccess
3232
from .mutation import MutationManager
33+
from .update import ALLUPDATES
3334

3435
_logger = logging.getLogger("cwltool")
3536

@@ -129,6 +130,7 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
129130
exgroup.add_argument("--pack", action="store_true", help="Combine components into single document and print.")
130131
exgroup.add_argument("--version", action="store_true", help="Print version and exit")
131132
exgroup.add_argument("--validate", action="store_true", help="Validate CWL document only.")
133+
exgroup.add_argument("--print-supported-versions", action="store_true", help="Print supported CWL specs.")
132134

133135
exgroup = parser.add_mutually_exclusive_group()
134136
exgroup.add_argument("--strict", action="store_true",
@@ -577,6 +579,10 @@ def versionstring():
577579
else:
578580
return u"%s %s" % (sys.argv[0], "unknown version")
579581

582+
def supportedCWLversions():
583+
versions = ALLUPDATES.keys()
584+
versions.sort()
585+
return versions
580586

581587
def main(argsl=None, # type: List[str]
582588
args=None, # type: argparse.Namespace
@@ -652,6 +658,10 @@ def main(argsl=None, # type: List[str]
652658
else:
653659
_logger.info(versionfunc())
654660

661+
if args.print_supported_versions:
662+
print("\n".join(supportedCWLversions()))
663+
return 0
664+
655665
if not args.workflow:
656666
if os.path.isfile("CWLFile"):
657667
setattr(args, "workflow", "CWLFile")

0 commit comments

Comments
 (0)