Skip to content

Commit a72a36c

Browse files
committed
feat: Add --extra-args to rsync-stub-generator
1 parent b82c09b commit a72a36c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

utils/rsync-stub-generator.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
import subprocess
55
import argparse
66
from pathlib import Path
7+
import shlex
78

89

9-
def main(upstream: str, dist: Path) -> None:
10+
def main(upstream: str, dist: Path, extra_args: list) -> None:
1011
p = subprocess.run(
11-
["rsync", "-a", "--no-motd", "-r", "--list-only", upstream],
12+
["rsync", "-a", "--no-motd", "-r", "--list-only", *extra_args, upstream],
1213
stdout=subprocess.PIPE,
1314
text=True,
1415
)
@@ -60,6 +61,12 @@ def main(upstream: str, dist: Path) -> None:
6061
default=Path("."),
6162
help="Path to save stub files, defaults to current directory",
6263
)
64+
parser.add_argument(
65+
"--extra-args",
66+
type=str,
67+
default="",
68+
help="Extra arguments to pass to rsync (split by shlex)",
69+
)
6370
args = parser.parse_args()
6471

65-
main(args.upstream, args.dist)
72+
main(args.upstream, args.dist, shlex.split(args.extra_args))

0 commit comments

Comments
 (0)