Allow settings to be specified with short '-s' option

This commit is contained in:
Jordan 2012-02-16 08:54:53 -05:00
parent 7b2388bb56
commit 102318497d
2 changed files with 7 additions and 2 deletions

View file

@ -45,6 +45,7 @@ settings="settings.json"
a=''; a='';
for arg in $*; do for arg in $*; do
if [ "$a" = "--settings" ]; then settings=$arg; fi if [ "$a" = "--settings" ]; then settings=$arg; fi
if [ "$a" = "-s" ]; then settings=$arg; fi
a=$arg a=$arg
done done
#Does a $settings exist? if no copy the template #Does a $settings exist? if no copy the template

View file

@ -22,7 +22,11 @@
var fs = require("fs"); var fs = require("fs");
var os = require("os"); var os = require("os");
var path = require('path'); var path = require('path');
var argv = require('optimist').argv;
/**
* Read in cli args
*/
exports.argv = require('optimist').argv;
/** /**
* The IP ep-lite should listen to * The IP ep-lite should listen to
@ -90,7 +94,7 @@ exports.abiwordAvailable = function()
} }
// Discover where the settings file lives // Discover where the settings file lives
var settingsFilename = argv.settings || "settings.json"; var settingsFilename = exports.argv.settings || exports.argv.s || "settings.json";
var settingsPath = settingsFilename.charAt(0) == '/' ? '' : path.normalize(__dirname + "/../../"); var settingsPath = settingsFilename.charAt(0) == '/' ? '' : path.normalize(__dirname + "/../../");
//read the settings sync //read the settings sync