Skip to content

Commit

Permalink
Add command version to bonfire (#142)
Browse files Browse the repository at this point in the history
* Add command 'version'

Co-authored-by: Brandon Schneider <[email protected]>
  • Loading branch information
ruda and skarekrow authored Oct 27, 2021
1 parent f33c8cd commit ba5e19d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bonfire/bonfire.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit ba5e19d

Please sign in to comment.