Skip to content

Commit ecc6b9e

Browse files
committed
relink.py: source_root is now a positional argument.
1 parent 4aa83bb commit ecc6b9e

4 files changed

Lines changed: 3 additions & 7 deletions

File tree

relink.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ def parse_arguments():
233233
)
234234
)
235235
parser.add_argument(
236-
"--source-root",
236+
"source_root",
237+
nargs="?",
237238
type=validate_directory,
238239
default=DEFAULT_SOURCE_ROOT,
239240
help=(

tests/relink/test_args.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_custom_source_root(self, mock_default_dirs, tmp_path):
5151
_, target_dir = mock_default_dirs
5252
custom_source = tmp_path / "custom_source"
5353
custom_source.mkdir()
54-
with patch("sys.argv", ["relink.py", "--source-root", str(custom_source)]):
54+
with patch("sys.argv", ["relink.py", str(custom_source)]):
5555
args = relink.parse_arguments()
5656
assert args.source_root == str(custom_source.resolve())
5757
assert args.target_root == target_dir
@@ -76,7 +76,6 @@ def test_both_custom_paths(self, tmp_path):
7676
"sys.argv",
7777
[
7878
"relink.py",
79-
"--source-root",
8079
str(source_path),
8180
"--target-root",
8281
str(target_path),

tests/relink/test_cmdline.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def test_command_line_execution_dry_run(mock_dirs):
4040
command = [
4141
sys.executable,
4242
relink_script,
43-
"--source-root",
4443
str(source_dir),
4544
"--target-root",
4645
str(target_dir),
@@ -76,7 +75,6 @@ def test_command_line_execution_actual_run(mock_dirs):
7675
command = [
7776
sys.executable,
7877
relink_script,
79-
"--source-root",
8078
str(source_dir),
8179
"--target-root",
8280
str(target_dir),

tests/relink/test_timing.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def test_timing_logging(tmp_path, caplog, use_timing, should_log_timing):
3737
# Build argv with or without --timing flag
3838
test_argv = [
3939
"relink.py",
40-
"--source-root",
4140
str(source_dir),
4241
"--target-root",
4342
str(target_dir),
@@ -75,7 +74,6 @@ def test_timing_shows_in_quiet_mode(tmp_path, caplog):
7574
# Build argv with both --timing and --quiet flags
7675
test_argv = [
7776
"relink.py",
78-
"--source-root",
7977
str(source_dir),
8078
"--target-root",
8179
str(target_dir),

0 commit comments

Comments
 (0)