From 233ea3efb94f8e5b291fa41e943d27a6057ef96b Mon Sep 17 00:00:00 2001 From: AramJonghu Date: Tue, 26 May 2026 09:30:58 +0200 Subject: [PATCH] accidental duplicate logic removed --- cli/src/zshell/__init__.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/cli/src/zshell/__init__.py b/cli/src/zshell/__init__.py index 8e101e2..57ba1c6 100644 --- a/cli/src/zshell/__init__.py +++ b/cli/src/zshell/__init__.py @@ -7,7 +7,7 @@ import typer from typer._completion_shared import install, _get_shell_name from zshell.subcommands import shell, scheme, screenshot, wallpaper, record -app = typer.Typer(name="zshell-cli") +app = typer.Typer(name="zshell-cli", add_completion=False) app.add_typer(shell.app, name="shell") app.add_typer(scheme.app, name="scheme") @@ -44,16 +44,10 @@ def _install_completion() -> None: pass -@app.callback() -def main_options( - install_autocomplete: bool = typer.Option(False, "--install-autocomplete", help="Install shell completion for tab-completion."), -): - if install_autocomplete: - _install_completion() - raise typer.Exit() - - def main() -> None: + if "--install-autocomplete" in sys.argv: + _install_completion() + return if sys.stdout.isatty() and not _completion_installed(): click.echo("zshell-cli: Tip: run with --install-autocomplete for tab completion.", err=True) app()