From f02165aafb179cdb8f27c446fc39ea4f396a8b8d Mon Sep 17 00:00:00 2001 From: Ryan Reed Date: Tue, 12 Jul 2022 20:32:04 -0400 Subject: [PATCH] Moving store-path to a global argument --- src/transpose/console.py | 14 +++++++------- tests/test_console.py | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/transpose/console.py b/src/transpose/console.py index 96ead32..24ec517 100644 --- a/src/transpose/console.py +++ b/src/transpose/console.py @@ -41,6 +41,13 @@ def parse_arguments(args=None): """, ) parser.add_argument("--version", action="version", version=f"Transpose {version}") + parser.add_argument( + "--store-path", + dest="store_path", + nargs="?", + default=store_path, + help="The path to where the targets should be stored (default: %(default)s)", + ) subparsers = parser.add_subparsers( help="Transpose Action", dest="action", required=True @@ -79,13 +86,6 @@ def parse_arguments(args=None): "target_path", help="The path to the directory that should be moved to storage", ) - store_parser.add_argument( - "--store-path", - dest="store_path", - nargs="?", - default=store_path, - help="The path to where the target should be stored (default: %(default)s)", - ) return parser.parse_args(args) diff --git a/tests/test_console.py b/tests/test_console.py index de6eff5..e047a0c 100644 --- a/tests/test_console.py +++ b/tests/test_console.py @@ -10,11 +10,11 @@ def test_parse_arguments(): args = parse_arguments( [ + "--store-path", + "/mnt/store", "store", "--cache-filename", "test-cache-file.json", - "--store-path", - "/mnt/store", "MyTarget", "/tmp/some/path", ]