Skip to content

Commit

Permalink
add version to the arg parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Sispheor committed Dec 2, 2022
1 parent c03b65a commit 16cc890
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions monkeyble/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# https://www.python.org/dev/peps/pep-0440/
__version__ = "1.1.3.dev0"
5 changes: 4 additions & 1 deletion monkeyble/cli/monkeyble_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import subprocess
import sys
import time
from datetime import datetime, timedelta
from datetime import timedelta

import yaml
from tabulate import tabulate
Expand All @@ -15,6 +15,7 @@
from monkeyble.cli.exceptions import MonkeybleCLIException
from monkeyble.cli.models import MonkeybleResult, ScenarioResult
from monkeyble.cli.utils import Utils
from monkeyble._version import __version__

logger = logging.getLogger(MONKEYBLE)

Expand Down Expand Up @@ -163,6 +164,8 @@ def parse_args(args):
parser.add_argument("action", help="[test]")
parser.add_argument("-c", "--config",
help="Path to the monkeyble config")
parser.add_argument('-v', '--version', action='version',
version="Monkeyble {version}".format(version=__version__))

# parse arguments from script parameters
return parser.parse_args(args)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "monkeyble"
version = "1.1.3.dev0"
version = "1.1.3.dev0" # /!\ version placed in monkeyble._version and in galaxy.yml files too
description = "End-to-end testing framework for Ansible"
authors = ["Nicolas Marcq <[email protected]>"]
license = "GNU General Public License v3 (GPLv3)"
Expand Down

0 comments on commit 16cc890

Please sign in to comment.