|
30 | 30 | from .resolver import tool_resolver, ga4gh_tool_registries
|
31 | 31 | from .stdfsaccess import StdFsAccess
|
32 | 32 | from .mutation import MutationManager
|
| 33 | +from .update import ALLUPDATES |
33 | 34 |
|
34 | 35 | _logger = logging.getLogger("cwltool")
|
35 | 36 |
|
@@ -129,6 +130,7 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
|
129 | 130 | exgroup.add_argument("--pack", action="store_true", help="Combine components into single document and print.")
|
130 | 131 | exgroup.add_argument("--version", action="store_true", help="Print version and exit")
|
131 | 132 | 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.") |
132 | 134 |
|
133 | 135 | exgroup = parser.add_mutually_exclusive_group()
|
134 | 136 | exgroup.add_argument("--strict", action="store_true",
|
@@ -577,6 +579,10 @@ def versionstring():
|
577 | 579 | else:
|
578 | 580 | return u"%s %s" % (sys.argv[0], "unknown version")
|
579 | 581 |
|
| 582 | +def supportedCWLversions(): |
| 583 | + versions = ALLUPDATES.keys() |
| 584 | + versions.sort() |
| 585 | + return versions |
580 | 586 |
|
581 | 587 | def main(argsl=None, # type: List[str]
|
582 | 588 | args=None, # type: argparse.Namespace
|
@@ -652,6 +658,10 @@ def main(argsl=None, # type: List[str]
|
652 | 658 | else:
|
653 | 659 | _logger.info(versionfunc())
|
654 | 660 |
|
| 661 | + if args.print_supported_versions: |
| 662 | + print("\n".join(supportedCWLversions())) |
| 663 | + return 0 |
| 664 | + |
655 | 665 | if not args.workflow:
|
656 | 666 | if os.path.isfile("CWLFile"):
|
657 | 667 | setattr(args, "workflow", "CWLFile")
|
|
0 commit comments