Skip to content

Commit 1cae604

Browse files
authored
feat: Add version argument (#190)
Signed-off-by: Mia Battad <133708990+miabatta@users.noreply.github.com>
1 parent a158f68 commit 1cae604

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/openjd/cli/_create_argparser.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import traceback
66
from typing import Optional
77

8+
from ._version import version
9+
810
from ._common import SubparserGroup
911

1012
from ._check import populate_argparser as populate_check_subparser
@@ -22,6 +24,11 @@ def create_argparser() -> ArgumentParser:
2224
"""Generate the root argparser for the CLI"""
2325
parser = ArgumentParser(prog="openjd", usage="openjd <command> [arguments]")
2426
parser.set_defaults(func=lambda _: parser.print_help())
27+
28+
parser.add_argument(
29+
"--version", action="version", version=f"Open Job Description CLI {version}"
30+
)
31+
2532
subcommands = SubparserGroup(
2633
parser,
2734
title="commands",

0 commit comments

Comments
 (0)