Skip to content

Commit 6415412

Browse files
Merge 506c0d1 into ffad7fa
2 parents ffad7fa + 506c0d1 commit 6415412

File tree

4 files changed

+330
-59
lines changed

4 files changed

+330
-59
lines changed

Diff for: lib/cli.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const path = require('path')
44
const assert = require('assert')
5-
const optimist = require('optimist')
5+
const yargs = require('yargs')
66
const fs = require('graceful-fs')
77

88
const Server = require('./server')
@@ -11,7 +11,7 @@ const constant = require('./constants')
1111

1212
function processArgs (argv, options, fs, path) {
1313
if (argv.help) {
14-
console.log(optimist.help())
14+
console.log(yargs.help())
1515
process.exit(0)
1616
}
1717

@@ -152,7 +152,7 @@ function argsBeforeDoubleDash (argv) {
152152
}
153153

154154
function describeShared () {
155-
optimist
155+
yargs
156156
.usage('Karma - Spectacular Test Runner for JavaScript.\n\n' +
157157
'Usage:\n' +
158158
' $0 <command>\n\n' +
@@ -167,7 +167,7 @@ function describeShared () {
167167
}
168168

169169
function describeInit () {
170-
optimist
170+
yargs
171171
.usage('Karma - Spectacular Test Runner for JavaScript.\n\n' +
172172
'INIT - Initialize a config file.\n\n' +
173173
'Usage:\n' +
@@ -179,7 +179,7 @@ function describeInit () {
179179
}
180180

181181
function describeStart () {
182-
optimist
182+
yargs
183183
.usage('Karma - Spectacular Test Runner for JavaScript.\n\n' +
184184
'START - Start the server / do a single run.\n\n' +
185185
'Usage:\n' +
@@ -205,7 +205,7 @@ function describeStart () {
205205
}
206206

207207
function describeRun () {
208-
optimist
208+
yargs
209209
.usage('Karma - Spectacular Test Runner for JavaScript.\n\n' +
210210
'RUN - Run the tests (requires running server).\n\n' +
211211
'Usage:\n' +
@@ -221,7 +221,7 @@ function describeRun () {
221221
}
222222

223223
function describeStop () {
224-
optimist
224+
yargs
225225
.usage('Karma - Spectacular Test Runner for JavaScript.\n\n' +
226226
'STOP - Stop the server (requires running server).\n\n' +
227227
'Usage:\n' +
@@ -232,7 +232,7 @@ function describeStop () {
232232
}
233233

234234
function describeCompletion () {
235-
optimist
235+
yargs
236236
.usage('Karma - Spectacular Test Runner for JavaScript.\n\n' +
237237
'COMPLETION - Bash/ZSH completion for karma.\n\n' +
238238
'Installation:\n' +
@@ -245,7 +245,7 @@ function printRunnerProgress (data) {
245245
}
246246

247247
exports.process = function () {
248-
const argv = optimist.parse(argsBeforeDoubleDash(process.argv.slice(2)))
248+
const argv = yargs.parse(argsBeforeDoubleDash(process.argv.slice(2)))
249249
const options = {
250250
cmd: argv._.shift()
251251
}
@@ -280,7 +280,7 @@ exports.process = function () {
280280
} else {
281281
console.error('Unknown command "' + options.cmd + '".')
282282
}
283-
optimist.showHelp()
283+
yargs.showHelp()
284284
process.exit(1)
285285
}
286286

0 commit comments

Comments
 (0)