Skip to content

Commit 0d65a3e

Browse files
committed
[CLI] Add a --version option
1 parent 1001189 commit 0d65a3e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/fuddly/cli/__init__.py

+12
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ def main(argv: List[str] = None):
6666
epilog="use 'fuddly <action>' help more information on their arguments",
6767
exit_on_error=False
6868
)
69+
parsers["main"].add_argument(
70+
"-v",
71+
"--version",
72+
action="store_true",
73+
help="print the vesion and exit",
74+
)
75+
6976
subparsers = arg_parser.add_subparsers(help="", dest="action", metavar="action")
7077

7178
with subparsers.add_parser("shell", help="launch the fuddly interactive shell") as p:
@@ -190,6 +197,11 @@ def main(argv: List[str] = None):
190197
arg_parser.print_help()
191198
return 0
192199

200+
if args.version:
201+
from fuddly.framework.global_resources import fuddly_version
202+
print(fuddly_version)
203+
return 0
204+
193205
if args.action is None:
194206
arg_parser.print_help()
195207
return 0

0 commit comments

Comments
 (0)