Add config option

This commit is contained in:
Typicode
2016-03-16 13:53:12 +01:00
parent ab3e611d5c
commit 841bd7f42a
2 changed files with 8 additions and 2 deletions

View File

@ -26,7 +26,7 @@
"server-destroy": "^1.0.1", "server-destroy": "^1.0.1",
"underscore-db": "^0.9.1", "underscore-db": "^0.9.1",
"update-notifier": "^0.5.0", "update-notifier": "^0.5.0",
"yargs": "^3.10.0" "yargs": "^4.2.0"
}, },
"devDependencies": { "devDependencies": {
"husky": "^0.6.1", "husky": "^0.6.1",

View File

@ -8,6 +8,7 @@ module.exports = function () {
updateNotifier({ pkg: pkg }).notify() updateNotifier({ pkg: pkg }).notify()
var argv = yargs var argv = yargs
.config('config')
.usage('$0 [options] <source>') .usage('$0 [options] <source>')
.options({ .options({
port: { port: {
@ -26,7 +27,7 @@ module.exports = function () {
}, },
routes: { routes: {
alias: 'r', alias: 'r',
description: 'Load routes file' description: 'Path to routes file'
}, },
static: { static: {
alias: 's', alias: 's',
@ -57,6 +58,11 @@ module.exports = function () {
quiet: { quiet: {
alias: 'q', alias: 'q',
description: 'Suppress log messages from output' description: 'Suppress log messages from output'
},
config: {
alias: 'c',
description: 'Path to config file',
default: 'json-server.json'
} }
}) })
.boolean('watch') .boolean('watch')