Replace nomnom with commander
This commit is contained in:
parent
1c890b0157
commit
a74ca20375
2 changed files with 38 additions and 41 deletions
|
@ -28,13 +28,13 @@
|
||||||
"canvas": "1.6.8",
|
"canvas": "1.6.8",
|
||||||
"clone": "2.1.1",
|
"clone": "2.1.1",
|
||||||
"color": "1.0.3",
|
"color": "1.0.3",
|
||||||
|
"commander": "2.1.0",
|
||||||
"cors": "2.8.4",
|
"cors": "2.8.4",
|
||||||
"express": "4.16.2",
|
"express": "4.16.2",
|
||||||
"glyph-pbf-composite": "0.0.2",
|
"glyph-pbf-composite": "0.0.2",
|
||||||
"handlebars": "4.0.11",
|
"handlebars": "4.0.11",
|
||||||
"http-shutdown": "^1.2.0",
|
"http-shutdown": "^1.2.0",
|
||||||
"morgan": "1.9.0",
|
"morgan": "1.9.0",
|
||||||
"nomnom": "1.8.1",
|
|
||||||
"pbf": "3.0.5",
|
"pbf": "3.0.5",
|
||||||
"proj4": "2.4.4",
|
"proj4": "2.4.4",
|
||||||
"request": "2.83.0",
|
"request": "2.83.0",
|
||||||
|
|
77
src/main.js
77
src/main.js
|
@ -10,46 +10,43 @@ var mbtiles = require('@mapbox/mbtiles');
|
||||||
|
|
||||||
var packageJson = require('../package');
|
var packageJson = require('../package');
|
||||||
|
|
||||||
var opts = require('nomnom')
|
var opts = require('commander')
|
||||||
.option('mbtiles', {
|
.description('tileserver-gl startup options')
|
||||||
default: undefined,
|
.usage('tileserver-gl [mbtiles] [options]')
|
||||||
help: 'MBTiles file (uses demo configuration);\n' +
|
.option(
|
||||||
'\t ignored if the configuration file is also specified',
|
'--mbtiles <file>',
|
||||||
position: 0
|
'MBTiles file (uses demo configuration);\n' +
|
||||||
})
|
'\t ignored if the configuration file is also specified'
|
||||||
.option('config', {
|
)
|
||||||
abbr: 'c',
|
.option(
|
||||||
default: 'config.json',
|
'-c, --config <file>',
|
||||||
help: 'Configuration file'
|
'Configuration file',
|
||||||
})
|
'config.json'
|
||||||
.option('bind', {
|
)
|
||||||
abbr: 'b',
|
.option(
|
||||||
default: undefined,
|
'-b, --bind <address>',
|
||||||
help: 'Bind address'
|
'Bind address'
|
||||||
})
|
)
|
||||||
.option('port', {
|
.option(
|
||||||
abbr: 'p',
|
'-p, --port <port>',
|
||||||
default: 8080,
|
'Port',
|
||||||
help: 'Port'
|
parseInt,
|
||||||
})
|
8080
|
||||||
.option('cors', {
|
)
|
||||||
default: true,
|
.option(
|
||||||
help: 'Enable Cross-origin resource sharing headers'
|
'-C|--no-cors',
|
||||||
})
|
'Disable Cross-origin resource sharing headers'
|
||||||
.option('verbose', {
|
)
|
||||||
abbr: 'V',
|
.option(
|
||||||
flag: true,
|
'-V, --verbose',
|
||||||
help: 'More verbose output'
|
'More verbose output'
|
||||||
})
|
)
|
||||||
.option('version', {
|
.option(
|
||||||
abbr: 'v',
|
'-v, --version',
|
||||||
flag: true,
|
'Version info',
|
||||||
help: 'Version info',
|
packageJson.version
|
||||||
callback: function() {
|
)
|
||||||
return packageJson.name + ' v' + packageJson.version;
|
.parse(process.argv);
|
||||||
}
|
|
||||||
}).parse();
|
|
||||||
|
|
||||||
|
|
||||||
console.log('Starting ' + packageJson.name + ' v' + packageJson.version);
|
console.log('Starting ' + packageJson.name + ' v' + packageJson.version);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue