Skip to content

Commit

Permalink
chore: typer follow up on no_args_is_help (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan committed Apr 25, 2024
1 parent 0118127 commit f46cf32
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/ss_python/cli.py
Expand Up @@ -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."""
Expand Down
3 changes: 0 additions & 3 deletions template/src/{{ module_name }}/cli.py.jinja
Expand Up @@ -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 }}."""
Expand Down

0 comments on commit f46cf32

Please sign in to comment.