diff --git a/bonfire/bonfire.py b/bonfire/bonfire.py index d625287b..26cd1606 100755 --- a/bonfire/bonfire.py +++ b/bonfire/bonfire.py @@ -6,6 +6,12 @@ import sys import warnings +from importlib.metadata import version, PackageNotFoundError +try: + __version__ = version("crc-bonfire") +except PackageNotFoundError: + __version__ = "(unknown)" + from tabulate import tabulate from wait_for import TimedOutError @@ -1105,6 +1111,12 @@ def _err_handler(err): click.echo(pod_name) +@main.command("version") +def _cmd_version(): + """Print bonfire version""" + click.echo("bonfire version " + __version__) + + @config.command("write-default") @click.argument("path", required=False, type=str) def _cmd_write_default_config(path):