2
2
3
3
const path = require ( 'path' )
4
4
const assert = require ( 'assert' )
5
- const optimist = require ( 'optimist ' )
5
+ const yargs = require ( 'yargs ' )
6
6
const fs = require ( 'graceful-fs' )
7
7
8
8
const Server = require ( './server' )
@@ -11,7 +11,7 @@ const constant = require('./constants')
11
11
12
12
function processArgs ( argv , options , fs , path ) {
13
13
if ( argv . help ) {
14
- console . log ( optimist . help ( ) )
14
+ console . log ( yargs . help ( ) )
15
15
process . exit ( 0 )
16
16
}
17
17
@@ -152,7 +152,7 @@ function argsBeforeDoubleDash (argv) {
152
152
}
153
153
154
154
function describeShared ( ) {
155
- optimist
155
+ yargs
156
156
. usage ( 'Karma - Spectacular Test Runner for JavaScript.\n\n' +
157
157
'Usage:\n' +
158
158
' $0 <command>\n\n' +
@@ -167,7 +167,7 @@ function describeShared () {
167
167
}
168
168
169
169
function describeInit ( ) {
170
- optimist
170
+ yargs
171
171
. usage ( 'Karma - Spectacular Test Runner for JavaScript.\n\n' +
172
172
'INIT - Initialize a config file.\n\n' +
173
173
'Usage:\n' +
@@ -179,7 +179,7 @@ function describeInit () {
179
179
}
180
180
181
181
function describeStart ( ) {
182
- optimist
182
+ yargs
183
183
. usage ( 'Karma - Spectacular Test Runner for JavaScript.\n\n' +
184
184
'START - Start the server / do a single run.\n\n' +
185
185
'Usage:\n' +
@@ -205,7 +205,7 @@ function describeStart () {
205
205
}
206
206
207
207
function describeRun ( ) {
208
- optimist
208
+ yargs
209
209
. usage ( 'Karma - Spectacular Test Runner for JavaScript.\n\n' +
210
210
'RUN - Run the tests (requires running server).\n\n' +
211
211
'Usage:\n' +
@@ -221,7 +221,7 @@ function describeRun () {
221
221
}
222
222
223
223
function describeStop ( ) {
224
- optimist
224
+ yargs
225
225
. usage ( 'Karma - Spectacular Test Runner for JavaScript.\n\n' +
226
226
'STOP - Stop the server (requires running server).\n\n' +
227
227
'Usage:\n' +
@@ -232,7 +232,7 @@ function describeStop () {
232
232
}
233
233
234
234
function describeCompletion ( ) {
235
- optimist
235
+ yargs
236
236
. usage ( 'Karma - Spectacular Test Runner for JavaScript.\n\n' +
237
237
'COMPLETION - Bash/ZSH completion for karma.\n\n' +
238
238
'Installation:\n' +
@@ -245,7 +245,7 @@ function printRunnerProgress (data) {
245
245
}
246
246
247
247
exports . process = function ( ) {
248
- const argv = optimist . parse ( argsBeforeDoubleDash ( process . argv . slice ( 2 ) ) )
248
+ const argv = yargs . parse ( argsBeforeDoubleDash ( process . argv . slice ( 2 ) ) )
249
249
const options = {
250
250
cmd : argv . _ . shift ( )
251
251
}
@@ -280,7 +280,7 @@ exports.process = function () {
280
280
} else {
281
281
console . error ( 'Unknown command "' + options . cmd + '".' )
282
282
}
283
- optimist . showHelp ( )
283
+ yargs . showHelp ( )
284
284
process . exit ( 1 )
285
285
}
286
286
0 commit comments