Skip to content

Add --print-supported-versions option that prints supported CWL versions #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cwltool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from .resolver import tool_resolver, ga4gh_tool_registries
from .stdfsaccess import StdFsAccess
from .mutation import MutationManager
from .update import UPDATES, ALLUPDATES

_logger = logging.getLogger("cwltool")

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

exgroup = parser.add_mutually_exclusive_group()
exgroup.add_argument("--strict", action="store_true",
Expand Down Expand Up @@ -577,6 +579,14 @@ def versionstring():
else:
return u"%s %s" % (sys.argv[0], "unknown version")

def supportedCWLversions(enable_dev):
# type: (bool) -> List[Text]
if enable_dev:
versions = ALLUPDATES.keys()
else:
versions = UPDATES.keys()
versions.sort()
return versions

def main(argsl=None, # type: List[str]
args=None, # type: argparse.Namespace
Expand Down Expand Up @@ -652,6 +662,10 @@ def main(argsl=None, # type: List[str]
else:
_logger.info(versionfunc())

if args.print_supported_versions:
print("\n".join(supportedCWLversions(args.enable_dev)))
return 0

if not args.workflow:
if os.path.isfile("CWLFile"):
setattr(args, "workflow", "CWLFile")
Expand Down