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():
42
42
def show_basic_usage ():
43
43
seleniumbase_logo = logo_helper .get_seleniumbase_logo ()
44
44
print (seleniumbase_logo )
45
+ print ("%s" % get_version ()[0 :1 ])
45
46
print ("" )
46
47
print ('Usage: "seleniumbase [COMMAND] [PARAMETERS]"' )
47
48
print ("Commands:" )
@@ -256,6 +257,16 @@ def show_grid_node_usage():
256
257
print ("" )
257
258
258
259
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
+
259
270
def show_detailed_help ():
260
271
show_basic_usage ()
261
272
print ("More Info:" )
@@ -359,6 +370,11 @@ def main():
359
370
else :
360
371
show_basic_usage ()
361
372
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 ()
362
378
elif command == "help" or command == "--help" :
363
379
if len (command_args ) >= 1 :
364
380
if command_args [0 ] == "install" :
You can’t perform that action at this time.
0 commit comments