Skip to content

Commit

Permalink
Add version in libkirk package
Browse files Browse the repository at this point in the history
  • Loading branch information
acerv committed Aug 11, 2023
1 parent 1bca140 commit 74b4614
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions libkirk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
from libkirk.events import EventsHandler


# Kirk version
VERSION = '1.0'


class KirkException(Exception):
"""
The most generic exception that is raised by any module when
Expand Down
11 changes: 11 additions & 0 deletions libkirk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,13 @@ def run(cmd_args: list = None) -> None:
parser = argparse.ArgumentParser(
description='Kirk - All-in-one Linux Testing Framework')

# generic arguments
parser.add_argument(
"--version",
"-V",
action="store_true",
help="Print current version")

# user interface arguments
parser.add_argument(
"--verbose",
Expand Down Expand Up @@ -446,6 +453,10 @@ def run(cmd_args: list = None) -> None:
# parse comand line
args = parser.parse_args(cmd_args)

if args.version:
print(f"kirk {libkirk.VERSION}")
parser.exit(RC_OK)

if args.sut and "help" in args.sut:
print(args.sut["help"])
parser.exit(RC_OK)
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
:synopsis: installer module
.. moduleauthor:: Andrea Cervesato <[email protected]>
"""
import libkirk
from setuptools import setup

setup(
name='kirk',
version='1.0',
version=libkirk.VERSION,
description='All-in-one Linux Testing Framework',
author='Andrea Cervesato',
author_email='[email protected]',
Expand Down

0 comments on commit 74b4614

Please sign in to comment.