fix(cli): fix crash

This commit is contained in:
Roman Hotsiy 2018-03-20 12:49:25 +02:00
parent 06b5a00a8b
commit 8891f5c97d
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
2 changed files with 5 additions and 4 deletions

View File

@ -113,6 +113,7 @@ yargs
} }
}, },
) )
.demandCommand()
.options('t', { .options('t', {
alias: 'template', alias: 'template',
describe: 'Path to handlebars page template, see https://git.io/vxZ3V for the example ', describe: 'Path to handlebars page template, see https://git.io/vxZ3V for the example ',
@ -120,8 +121,7 @@ yargs
}) })
.options('options', { .options('options', {
describe: 'ReDoc options, use dot notation, e.g. options.nativeScrollbars', describe: 'ReDoc options, use dot notation, e.g. options.nativeScrollbars',
}) }).argv;
.demandCommand().argv;
async function serve(port: number, pathToSpec: string, options: Options = {}) { async function serve(port: number, pathToSpec: string, options: Options = {}) {
let spec = await loadAndBundleSpec(pathToSpec); let spec = await loadAndBundleSpec(pathToSpec);

View File

@ -1,6 +1,6 @@
{ {
"name": "redoc-cli", "name": "redoc-cli",
"version": "0.3.1", "version": "0.3.3",
"description": "ReDoc's Command Line Interface", "description": "ReDoc's Command Line Interface",
"main": "index.js", "main": "index.js",
"bin": "index.js", "bin": "index.js",
@ -12,7 +12,8 @@
"isarray": "^2.0.4", "isarray": "^2.0.4",
"react": "^16.3.0-alpha.2", "react": "^16.3.0-alpha.2",
"react-dom": "^16.3.0-alpha.2", "react-dom": "^16.3.0-alpha.2",
"redoc": "^2.0.0-alpha.15" "redoc": "^2.0.0-alpha.15",
"yargs": "^11.0.0"
}, },
"scripts": { "scripts": {
"ci-publish": "ci-publish" "ci-publish": "ci-publish"