Add basic command line options
This commit is contained in:
24
src/main.js
24
src/main.js
@@ -2,7 +2,27 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var opts = require('nomnom')
|
||||
.option('config', {
|
||||
abbr: 'c',
|
||||
default: 'config.json',
|
||||
help: 'Configuration file'
|
||||
})
|
||||
.option('port', {
|
||||
abbr: 'p',
|
||||
default: 8080,
|
||||
help: 'Port'
|
||||
})
|
||||
.option('version', {
|
||||
abbr: 'v',
|
||||
flag: true,
|
||||
help: 'Version info',
|
||||
callback: function() {
|
||||
return 'version ' + require('../package.json').version;
|
||||
}
|
||||
}).parse();
|
||||
|
||||
return require('./server')({
|
||||
config: 'config.json',
|
||||
port: 8080
|
||||
config: opts.config,
|
||||
port: opts.port
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user