From d35075d3251edb9d9695e49df7fc03c9f275038b Mon Sep 17 00:00:00 2001 From: Xuan Hu Date: Thu, 25 Apr 2024 09:42:43 +0800 Subject: [PATCH] chore: typer follow up on no_args_is_help --- src/ss_python/cli.py | 3 --- template/src/{{ module_name }}/cli.py.jinja | 3 --- 2 files changed, 6 deletions(-) diff --git a/src/ss_python/cli.py b/src/ss_python/cli.py index 9326bb51..57b284e2 100644 --- a/src/ss_python/cli.py +++ b/src/ss_python/cli.py @@ -13,9 +13,6 @@ def run() -> None: # NOTE(huxuan): callback is required for single command as a subcommand in typer. # And it is a convenient way to document the cli here. # Reference: https://typer.tiangolo.com/tutorial/commands/one-or-multiple/#one-command-and-one-callback -# BTW, `no_args_is_help` is set to `True` to avoid error when invoking the cli with no -# subcommands. The default behavior is strange and might change in the future. -# Reference: https://github.com/tiangolo/typer/issues/328 @app.callback(no_args_is_help=True) def main() -> None: """CLI for Serious Scaffold Python.""" diff --git a/template/src/{{ module_name }}/cli.py.jinja b/template/src/{{ module_name }}/cli.py.jinja index f66dd199..8a22df8c 100644 --- a/template/src/{{ module_name }}/cli.py.jinja +++ b/template/src/{{ module_name }}/cli.py.jinja @@ -13,9 +13,6 @@ def run() -> None: # NOTE(huxuan): callback is required for single command as a subcommand in typer. # And it is a convenient way to document the cli here. # Reference: https://typer.tiangolo.com/tutorial/commands/one-or-multiple/#one-command-and-one-callback -# BTW, `no_args_is_help` is set to `True` to avoid error when invoking the cli with no -# subcommands. The default behavior is strange and might change in the future. -# Reference: https://github.com/tiangolo/typer/issues/328 @app.callback(no_args_is_help=True) def main() -> None: """CLI for {{ project_name }}."""