Skip to content

Commit 23ffa33

Browse files
committed
Add cloud cli version to --version output
1 parent 9143ef9 commit 23ffa33

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/fastapi_cli/cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@
5151
def version_callback(value: bool) -> None:
5252
if value:
5353
print(f"FastAPI CLI version: [green]{__version__}[/green]")
54+
try:
55+
from fastapi_cloud_cli import (
56+
__version__ as cloud_cli_version,
57+
)
58+
59+
print(f"FastAPI Cloud CLI version: [green]{cloud_cli_version}[/green]")
60+
except ImportError: # pragma: no cover
61+
pass
62+
5463
raise typer.Exit()
5564

5665

tests/test_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ def test_version() -> None:
452452
result = runner.invoke(app, ["--version"])
453453
assert result.exit_code == 0, result.output
454454
assert "FastAPI CLI version:" in result.output
455+
assert "FastAPI Cloud CLI version:" in result.output
455456

456457

457458
def test_dev_reload_dir() -> None:

0 commit comments

Comments
 (0)