Skip to content

Commit 2bf73e8

Browse files
committed
feat(sync): vcspull sync with no args shows help
1 parent e4476ea commit 2bf73e8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/vcspull/cli/sync.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def clamp(n, _min, _max):
6464

6565

6666
@click.command(name="sync")
67+
@click.pass_context
6768
@click.argument(
6869
"repo_terms", type=click.STRING, nargs=-1, shell_complete=get_repo_completions
6970
)
@@ -83,7 +84,7 @@ def clamp(n, _min, _max):
8384
default=False,
8485
help="Exit immediately when encountering an error syncing multiple repos",
8586
)
86-
def sync(repo_terms, config, exit_on_error: bool) -> None:
87+
def sync(ctx, repo_terms, config, exit_on_error: bool) -> None:
8788
if config:
8889
configs = load_configs([config])
8990
else:
@@ -108,7 +109,8 @@ def sync(repo_terms, config, exit_on_error: bool) -> None:
108109
filter_repos(configs, dir=dir, vcs_url=vcs_url, name=name)
109110
)
110111
else:
111-
found_repos = configs
112+
click.echo(ctx.get_help(), color=ctx.color)
113+
ctx.exit()
112114

113115
for repo in found_repos:
114116
try:

0 commit comments

Comments
 (0)