@@ -94,51 +94,47 @@ def load_config
9494
9595 # Parses the options passed via command line
9696 def parse_argv
97- begin
98- cli argv ,
99- # Cucumber options
100- '-t' => lambda { |t | add_multiple ( 'tags' , t ) } ,
101- '-n --name' => lambda { |n | add_multiple ( 'name' , n ) } ,
102- '-f --format' => -> ( f ) { @parameters [ 'format' ] = "--format #{ f } " } ,
103- '-d --dry-run' => -> { @parameters [ 'dry_run' ] = "--dry-run" } ,
104- '-v --verbose' => -> { @parameters [ 'verbose' ] = "--verbose" } ,
105- '-s --strict' => -> { @parameters [ 'strict' ] = "--strict" } ,
106- '-g --guess' => -> { @parameters [ 'guess' ] = "--guess" } ,
107- '-x --expand' => -> { @parameters [ 'expand' ] = "--expand" } ,
108-
109- # All options below have been added for custom project but can be used for example
110- # Global options
111- '-e --environment' => -> ( e ) { @parameters [ 'environment' ] = "ENVIRONMENT=#{ e } " } ,
112- '-l --loglevel' => -> ( l ) { @parameters [ 'log_level' ] = "LOG_LEVEL=#{ l } " } ,
113- '-c --controller' => -> ( c ) { @parameters [ 'controller' ] = "CONTROLLER=#{ c } " } ,
114- '-h --headless' => -> { @parameters [ 'headless' ] = "HEADLESS=TRUE" } ,
115-
116- # Database options
117- '--cleanup' => -> { @parameters [ 'cleanup' ] = "CLEANUP=TRUE" } ,
118- '--no-cleanup' => -> { @parameters [ 'cleanup' ] = "CLEANUP=FALSE" } ,
119- '--database' => -> { @parameters [ 'database' ] = "DATABASE=TRUE" } ,
120- '--jenkins' => -> { @parameters [ 'jenkins' ] = "JENKINS=TRUE" } ,
121-
122- # Retry options
123- '--retries' => -> ( r ) { @parameters [ 'retries' ] = "RETRIES=#{ r } " } ,
124- '--timeout' => -> ( t ) { @parameters [ 'timeout' ] = "TIMEOUT=#{ t } " } ,
125-
126- # Driver Options
127- '--screen' => -> ( s ) { split_parameters ( s , 'screen' ) } ,
128- '--position' => -> ( p ) { split_parameters ( p , 'position' ) } ,
129- '--screenwidth' => -> ( w ) { @parameters [ 'screen_width' ] = "SCREENWIDTH=#{ w } " } ,
130- '--screenheight' => -> ( h ) { @parameters [ 'screen_height' ] = "SCREENHEIGHT=#{ h } " } ,
131- '--xposition' => -> ( x ) { @parameters [ 'xposition' ] = "XPOSITION=#{ x } " } ,
132- '--yposition' => -> ( y ) { @parameters [ 'yposition' ] = "YPOSITION=#{ y } " } ,
133- '-H --highlight' => -> { @parameters [ 'highlight' ] = "HIGHLIGHT=TRUE" } ,
134-
135- # Debug
136- '--debug' => -> { @parameters [ 'debug' ] = "DEBUG=TRUE" }
137- rescue
138- abort 'Error processing passed CLI arguments!' . red . underline
139- else
140- self
141- end
97+ cli argv ,
98+ # Cucumber options
99+ '-t' => lambda { |t | add_multiple ( 'tags' , t ) } ,
100+ '-n --name' => lambda { |n | add_multiple ( 'name' , n ) } ,
101+ '-f --format' => -> ( f ) { @parameters [ 'format' ] = "--format #{ f } " } ,
102+ '-d --dry-run' => -> { @parameters [ 'dry_run' ] = "--dry-run" } ,
103+ '-v --verbose' => -> { @parameters [ 'verbose' ] = "--verbose" } ,
104+ '-s --strict' => -> { @parameters [ 'strict' ] = "--strict" } ,
105+ '-g --guess' => -> { @parameters [ 'guess' ] = "--guess" } ,
106+ '-x --expand' => -> { @parameters [ 'expand' ] = "--expand" } ,
107+
108+ # All options below have been added for custom project but can be used for example
109+ # Global options
110+ '-e --environment' => -> ( e ) { @parameters [ 'environment' ] = "ENVIRONMENT=#{ e } " } ,
111+ '-l --loglevel' => -> ( l ) { @parameters [ 'log_level' ] = "LOG_LEVEL=#{ l } " } ,
112+ '-c --controller' => -> ( c ) { @parameters [ 'controller' ] = "CONTROLLER=#{ c } " } ,
113+ '-h --headless' => -> { @parameters [ 'headless' ] = "HEADLESS=TRUE" } ,
114+
115+ # Database options
116+ '--cleanup' => -> { @parameters [ 'cleanup' ] = "CLEANUP=TRUE" } ,
117+ '--no-cleanup' => -> { @parameters [ 'cleanup' ] = "CLEANUP=FALSE" } ,
118+ '--database' => -> { @parameters [ 'database' ] = "DATABASE=TRUE" } ,
119+ '--jenkins' => -> { @parameters [ 'jenkins' ] = "JENKINS=TRUE" } ,
120+
121+ # Retry options
122+ '--retries' => -> ( r ) { @parameters [ 'retries' ] = "RETRIES=#{ r } " } ,
123+ '--timeout' => -> ( t ) { @parameters [ 'timeout' ] = "TIMEOUT=#{ t } " } ,
124+
125+ # Driver Options
126+ '--screen' => -> ( s ) { split_parameters ( s , 'screen' ) } ,
127+ '--position' => -> ( p ) { split_parameters ( p , 'position' ) } ,
128+ '--screenwidth' => -> ( w ) { @parameters [ 'screen_width' ] = "SCREENWIDTH=#{ w } " } ,
129+ '--screenheight' => -> ( h ) { @parameters [ 'screen_height' ] = "SCREENHEIGHT=#{ h } " } ,
130+ '--xposition' => -> ( x ) { @parameters [ 'xposition' ] = "XPOSITION=#{ x } " } ,
131+ '--yposition' => -> ( y ) { @parameters [ 'yposition' ] = "YPOSITION=#{ y } " } ,
132+ '-H --highlight' => -> { @parameters [ 'highlight' ] = "HIGHLIGHT=TRUE" } ,
133+
134+ # Debug
135+ '--debug' => -> { @parameters [ 'debug' ] = "DEBUG=TRUE" }
136+ rescue
137+ abort 'Error processing passed CLI arguments!' . red . underline
142138 end
143139
144140 # Updates parameters based on config runtime defaults
0 commit comments