File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 8
8
from .diagnose .diagnose import define_subparser as diagnose_define_subparser
9
9
10
10
def parse_args ():
11
- parser = argparse .ArgumentParser (description = 'Spectacular AI command line tool' )
11
+ def get_sdk_version ():
12
+ from importlib .metadata import version , PackageNotFoundError
13
+ try :
14
+ return version ("spectacularAI" )
15
+ except PackageNotFoundError :
16
+ return None
17
+
18
+ version = get_sdk_version ()
19
+ if version :
20
+ description = f"Spectacular AI command line tool ({ version } )"
21
+ else :
22
+ description = "Spectacular AI command line tool"
23
+
24
+ parser = argparse .ArgumentParser (description = description )
12
25
subparsers = parser .add_subparsers (title = 'subcommands' , dest = 'subcommand' , required = True )
13
26
process_define_subparser (subparsers )
14
27
record_define_subparser (subparsers )
You can’t perform that action at this time.
0 commit comments