Skip to content

Commit

Permalink
Replace nomnom with commander
Browse files Browse the repository at this point in the history
  • Loading branch information
loicgasser committed Mar 8, 2018
1 parent 1c890b0 commit a74ca20
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 41 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -28,13 +28,13 @@
"canvas": "1.6.8",
"clone": "2.1.1",
"color": "1.0.3",
"commander": "2.1.0",
"cors": "2.8.4",
"express": "4.16.2",
"glyph-pbf-composite": "0.0.2",
"handlebars": "4.0.11",
"http-shutdown": "^1.2.0",
"morgan": "1.9.0",
"nomnom": "1.8.1",
"pbf": "3.0.5",
"proj4": "2.4.4",
"request": "2.83.0",
Expand Down
77 changes: 37 additions & 40 deletions src/main.js
Expand Up @@ -10,46 +10,43 @@ var mbtiles = require('@mapbox/mbtiles');

var packageJson = require('../package');

var opts = require('nomnom')
.option('mbtiles', {
default: undefined,
help: 'MBTiles file (uses demo configuration);\n' +
'\t ignored if the configuration file is also specified',
position: 0
})
.option('config', {
abbr: 'c',
default: 'config.json',
help: 'Configuration file'
})
.option('bind', {
abbr: 'b',
default: undefined,
help: 'Bind address'
})
.option('port', {
abbr: 'p',
default: 8080,
help: 'Port'
})
.option('cors', {
default: true,
help: 'Enable Cross-origin resource sharing headers'
})
.option('verbose', {
abbr: 'V',
flag: true,
help: 'More verbose output'
})
.option('version', {
abbr: 'v',
flag: true,
help: 'Version info',
callback: function() {
return packageJson.name + ' v' + packageJson.version;
}
}).parse();

var opts = require('commander')
.description('tileserver-gl startup options')
.usage('tileserver-gl [mbtiles] [options]')
.option(
'--mbtiles <file>',
'MBTiles file (uses demo configuration);\n' +
'\t ignored if the configuration file is also specified'
)
.option(
'-c, --config <file>',
'Configuration file',
'config.json'
)
.option(
'-b, --bind <address>',
'Bind address'
)
.option(
'-p, --port <port>',
'Port',
parseInt,
8080
)
.option(
'-C|--no-cors',
'Disable Cross-origin resource sharing headers'
)
.option(
'-V, --verbose',
'More verbose output'
)
.option(
'-v, --version',
'Version info',
packageJson.version
)
.parse(process.argv);

console.log('Starting ' + packageJson.name + ' v' + packageJson.version);

Expand Down

0 comments on commit a74ca20

Please sign in to comment.