@@ -78,7 +78,8 @@ function parseOptions(argv) {
78
78
seed ,
79
79
workerCount ;
80
80
81
- argv . forEach ( function ( arg ) {
81
+ for ( var i in argv ) {
82
+ var arg = argv [ i ] ;
82
83
if ( arg === '--no-color' ) {
83
84
color = false ;
84
85
} else if ( arg === '--color' ) {
@@ -103,12 +104,14 @@ function parseOptions(argv) {
103
104
configPath = arg . match ( "^--config=(.*)" ) [ 1 ] ;
104
105
} else if ( arg . match ( "^--reporter=" ) ) {
105
106
reporter = arg . match ( "^--reporter=(.*)" ) [ 1 ] ;
107
+ } else if ( arg === '--' ) {
108
+ break ;
106
109
} else if ( isFileArg ( arg ) ) {
107
110
files . push ( arg ) ;
108
111
} else if ( ! isEnvironmentVariable ( arg ) ) {
109
112
unknownOptions . push ( arg ) ;
110
113
}
111
- } ) ;
114
+ }
112
115
return {
113
116
color : color ,
114
117
configPath : configPath ,
@@ -180,7 +183,7 @@ function installExamples(options) {
180
183
181
184
function help ( options ) {
182
185
var print = options . print ;
183
- print ( 'Usage: jasmine [command] [options] [files]' ) ;
186
+ print ( 'Usage: jasmine [command] [options] [files] [--] ' ) ;
184
187
print ( '' ) ;
185
188
print ( 'Commands:' ) ;
186
189
Object . keys ( subCommands ) . forEach ( function ( cmd ) {
@@ -206,6 +209,7 @@ function help(options) {
206
209
print ( '%s\tpath to your optional jasmine.json' , lPad ( '--config=' , 18 ) ) ;
207
210
print ( '%s\tpath to reporter to use instead of the default Jasmine reporter' , lPad ( '--reporter=' , 18 ) ) ;
208
211
print ( '%s\tnumber of workers to run the tests in parallel. Default is 1' , lPad ( '--worker-count=' , 18 ) ) ;
212
+ print ( '%s\tmarker to signal the end of options meant for Jasmine' , lPad ( '--' , 18 ) ) ;
209
213
print ( '' ) ;
210
214
print ( 'The given arguments take precedence over options in your jasmine.json' ) ;
211
215
print ( 'The path to your optional jasmine.json can also be configured by setting the JASMINE_CONFIG_PATH environment variable' ) ;
0 commit comments