-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added parsing of CLI arguments and forwarding to Providers
- Loading branch information
Fabian Tollenaar
committed
Sep 14, 2014
1 parent
ef3b332
commit bf21b68
Showing
11 changed files
with
110 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,4 @@ | |
* | ||
*/ | ||
|
||
|
||
module.exports = require('./lib'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(function() { | ||
// Attach all argument to a "hidden" instance variable | ||
this.app.__argv = process.argv.slice(2); | ||
// Parse __argv and attach to instance variable argv | ||
this.app.argv = require('minimist')(this.app.__argv); | ||
|
||
if(typeof this.app.argv['D'] === 'boolean' || typeof this.app.argv['debug'] === 'boolean') { | ||
if(this.app.argv['D'] === true) this.app.config.debug = true; | ||
if(this.app.argv['debug'] === true) this.app.config.debug = true; | ||
} | ||
}).call(global); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,51 @@ | ||
{ | ||
"name": "saildata-server", | ||
"version": "0.1.12", | ||
"description": "An implementation of a [Signal K](http://signalk.github.io) central server for boats.", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "node ./index" | ||
}, | ||
"keywords": [ | ||
"signalk", | ||
"kjson", | ||
"nmea", | ||
"seatalk", | ||
"gps", | ||
"sailing", | ||
"boat", | ||
"marine", | ||
"nautic" | ||
], | ||
"author": "Fabian Tollenaar", | ||
"license": "GPLv3", | ||
"devDependencies": { | ||
"tape": "^2.12.1" | ||
}, | ||
"engine": { | ||
"node": "v0.10.x" | ||
}, | ||
"dependencies": { | ||
"colors": "^0.6.2", | ||
"ejson": "^1.0.1", | ||
"express": "3.x", | ||
"lodash": "^2.4.1", | ||
"nmea0183-signalk": "^0.1.12", | ||
"node-uuid": "^1.4.1", | ||
"socket.io": "^1.0.6", | ||
"stream-throttle": "^0.1.3", | ||
"memwatch": "*", | ||
"mdns": "^2.2.0" | ||
} | ||
} | ||
"name": "signalk-server-prototype", | ||
"version": "0.1.13", | ||
"description": "An implementation of a [Signal K](http://signalk.github.io) server for boats.", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "node ./index" | ||
}, | ||
"keywords": [ | ||
"signalk", | ||
"kjson", | ||
"nmea", | ||
"seatalk", | ||
"gps", | ||
"sailing", | ||
"boat", | ||
"marine", | ||
"nautic" | ||
], | ||
"license": "GPLv3", | ||
"author": "Fabian Tollenaar <[email protected]>", | ||
"contributors": [ | ||
{ | ||
"name": "Teppo Kurki", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/SignalK/server-prototype" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/SignalK/server-prototype/issues" | ||
}, | ||
"engine": { | ||
"node": "v0.10.x" | ||
}, | ||
"dependencies": { | ||
"colors": "^0.6.2", | ||
"ejson": "^1.0.1", | ||
"express": "3.x", | ||
"lodash": "^2.4.1", | ||
"mdns": "^2.2.0", | ||
"memwatch": "*", | ||
"minimist": "^1.1.0", | ||
"nmea0183-signalk": "^0.1.12", | ||
"node-uuid": "^1.4.1", | ||
"socket.io": "^1.0.6", | ||
"stream-throttle": "^0.1.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bf21b68
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for the moment. This way providers can not register cli arguments, but since they can access the raw args can process all args as they see fit and report whatever they want.
In addition to cli args passed to providers I would like a way to specify the settings file to be used, but go ahead and merge this plz.