File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
seleniumbase/console_scripts Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ def invalid_run_command(msg=None):
43
43
exp += " test frameworks.\n "
44
44
if not msg :
45
45
raise Exception ('INVALID RUN COMMAND!\n \n %s' % exp )
46
+ elif msg == "help" :
47
+ print ("\n %s" % exp )
48
+ sys .exit ()
46
49
else :
47
50
raise Exception ('INVALID RUN COMMAND!\n \n %s\n %s\n ' % (exp , msg ))
48
51
@@ -66,7 +69,9 @@ def main():
66
69
67
70
command_args = sys .argv [2 :]
68
71
dir_name = command_args [0 ]
69
- if len (str (dir_name )) < 2 :
72
+ if dir_name == "-h" or dir_name == "--help" :
73
+ invalid_run_command ("help" )
74
+ elif len (str (dir_name )) < 2 :
70
75
error_msg = (
71
76
'Directory name length must be at least 2 characters long!' )
72
77
elif "/" in str (dir_name ) or "\\ " in str (dir_name ):
@@ -85,7 +90,7 @@ def main():
85
90
options = command_args [1 :]
86
91
for option in options :
87
92
option = option .lower ()
88
- if option == "help " or option == "--help" :
93
+ if option == "-h " or option == "--help" :
89
94
help_me = True
90
95
elif option == "-b" or option == "--basic" :
91
96
basic = True
Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ def invalid_run_command(msg=None):
62
62
exp += ' is included.\n '
63
63
if not msg :
64
64
raise Exception ('INVALID RUN COMMAND!\n \n %s' % exp )
65
+ elif msg == "help" :
66
+ print ("\n %s" % exp )
67
+ sys .exit ()
65
68
else :
66
69
raise Exception ('INVALID RUN COMMAND!\n \n %s\n %s\n ' % (exp , msg ))
67
70
@@ -86,7 +89,9 @@ def main():
86
89
87
90
command_args = sys .argv [2 :]
88
91
file_name = command_args [0 ]
89
- if not file_name .endswith (".py" ):
92
+ if file_name == "-h" or file_name == "--help" :
93
+ invalid_run_command ("help" )
94
+ elif not file_name .endswith (".py" ):
90
95
error_msg = 'File name must end with ".py"!'
91
96
elif "*" in file_name or len (str (file_name )) < 4 :
92
97
error_msg = 'Invalid file name!'
@@ -105,7 +110,7 @@ def main():
105
110
options = command_args [1 :]
106
111
for option in options :
107
112
option = option .lower ()
108
- if option == "help " or option == "--help" :
113
+ if option == "-h " or option == "--help" :
109
114
help_me = True
110
115
elif option == "-b" or option == "--basic" :
111
116
basic = True
You can’t perform that action at this time.
0 commit comments