File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121from lib .core .settings import DUMMY_URL
2222from lib .core .settings import IS_WIN
2323from lib .core .settings import MAX_HELP_OPTION_LENGTH
24+ from lib .core .settings import VERSION_STRING
2425
2526def cmdLineParser ():
2627 """
@@ -37,6 +38,10 @@ def cmdLineParser():
3738 action = "store_true" ,
3839 help = "Show advanced help message and exit" )
3940
41+ parser .add_option ("--version" , dest = "showVersion" ,
42+ action = "store_true" ,
43+ help = "Show version string and exit" )
44+
4045 parser .add_option ("-v" , dest = "verbose" , type = "int" ,
4146 help = "Verbosity level: 0-6 (default %d)" % defaults .verbose )
4247
@@ -740,6 +745,9 @@ def _(self, *args):
740745 for i in xrange (len (sys .argv )):
741746 if sys .argv [i ] == '-hh' :
742747 sys .argv [i ] = '-h'
748+ elif sys .argv [i ] == '--version' :
749+ print VERSION_STRING
750+ raise SystemExit
743751 elif sys .argv [i ] == '-h' :
744752 advancedHelp = False
745753 for group in parser .option_groups [:]:
You can’t perform that action at this time.
0 commit comments