Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions fireblocks_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,39 @@

from fireblocks_cli.commands.configure import configure_app
import typer
from fireblocks_cli import __version__

app = typer.Typer()
app.add_typer(configure_app, name="configure")


@app.callback()
def main(
version: bool = typer.Option(
None,
"--version",
"-v",
help="Show the version and exit.",
is_eager=True,
callback=lambda v: (
(print(f"fireblocks-cli version {__version__}") or raise_exit())
if v
else None
),
)
):
pass


def raise_exit():
raise typer.Exit()


@app.command()
def version():
"""Show CLI version"""
typer.echo(f"fireblocks-cli version {__version__}")


if __name__ == "__main__":
app()