File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
seleniumbase/console_scripts Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ def show_usage():
4242def show_basic_usage ():
4343 seleniumbase_logo = logo_helper .get_seleniumbase_logo ()
4444 print (seleniumbase_logo )
45+ print ("%s" % get_version ()[0 :1 ])
4546 print ("" )
4647 print ('Usage: "seleniumbase [COMMAND] [PARAMETERS]"' )
4748 print ("Commands:" )
@@ -256,6 +257,16 @@ def show_grid_node_usage():
256257 print ("" )
257258
258259
260+ def get_version ():
261+ import pkg_resources
262+ return pkg_resources .require ("seleniumbase" )[0 :1 ]
263+
264+
265+ def show_version_info ():
266+ version = get_version ()
267+ print ('\n %s\n ' % version )
268+
269+
259270def show_detailed_help ():
260271 show_basic_usage ()
261272 print ("More Info:" )
@@ -359,6 +370,11 @@ def main():
359370 else :
360371 show_basic_usage ()
361372 show_grid_node_usage ()
373+ elif command == "version" or command == "--version" :
374+ if len (command_args ) == 0 :
375+ show_version_info ()
376+ else :
377+ show_basic_usage ()
362378 elif command == "help" or command == "--help" :
363379 if len (command_args ) >= 1 :
364380 if command_args [0 ] == "install" :
You can’t perform that action at this time.
0 commit comments