Skip to content

Commit 1a8abdb

Browse files
committed
Update console scripts for showing version info
1 parent 1e02158 commit 1a8abdb

File tree

1 file changed

+16
-0
lines changed
  • seleniumbase/console_scripts

1 file changed

+16
-0
lines changed

seleniumbase/console_scripts/run.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def show_usage():
4242
def 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+
259270
def 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":

0 commit comments

Comments
 (0)