Skip to content

Commit

Permalink
Make the default action to show help (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson authored Jan 10, 2024
1 parent 2e1cf5c commit 51f076a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/kubectl-ng/kubectl_ng/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def register(app, func, alias=None):
app.command()(func)


app = typer.Typer()
app = typer.Typer(no_args_is_help=True)
register(app, api_resources)
register(app, api_versions)
register(app, create)
Expand Down
12 changes: 12 additions & 0 deletions examples/kubectl-ng/kubectl_ng/tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-2024, Kr8s Developers (See LICENSE for list)
# SPDX-License-Identifier: BSD 3-Clause License
from kubectl_ng.cli import app
from typer.testing import CliRunner

runner = CliRunner()


def test_help_default():
result = runner.invoke(app, [])
assert result.exit_code == 0
assert "Usage:" in result.stdout

0 comments on commit 51f076a

Please sign in to comment.