Skip to content

Commit 7ad9bc2

Browse files
committed
make the output directory optional
1 parent 05ba832 commit 7ad9bc2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

cwlupgrader/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ def parse_args(args: List[str]) -> argparse.Namespace:
2424
"""Argument parser."""
2525
parser = argparse.ArgumentParser(
2626
description="Tool to upgrade CWL documents from one version to another. "
27-
"Supports 'draft-3' to 'v1.0' or 'v1.1' and 'v1.0' to 'v1.1'."
27+
"Supports 'draft-3' to 'v1.0' or 'v1.1' and 'v1.0' to 'v1.1'.",
28+
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
2829
)
2930
parser.add_argument(
3031
"--v1-only", help="Don't upgrade past cwlVersion: v1.0", action="store_true"
3132
)
32-
parser.add_argument("dir", help="Directory in which to save converted files")
33+
parser.add_argument(
34+
"--dir", help="Directory in which to save converted files", default=Path.cwd()
35+
)
3336
parser.add_argument(
3437
"inputs",
3538
nargs="+",

tests/test_complete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
def test_draft3_workflow(tmp_path):
9-
main([str(tmp_path), get_data('tests/draft-3-wf.cwl')])
9+
main([f"--dir={tmp_path}", get_data('tests/draft-3-wf.cwl')])
1010
result = filecmp.cmp(get_data('tests/draft-3-wf-v1.0.cwl'), tmp_path/"draft-3-wf.cwl",
1111
shallow=False)
1212
assert result

0 commit comments

Comments
 (0)