Permalink
Browse files

[fix] Fixed whitespace errors

  • Loading branch information...
1 parent 68c9266 commit dcb4b17919dcd2c66331e21b29f4d067fc21fd9e @pksunkara pksunkara committed May 18, 2012
Showing with 23 additions and 23 deletions.
  1. +6 −6 README.md
  2. +8 −8 lib/commands.js
  3. +6 −6 lib/flatiron-cli-config.js
  4. +1 −1 test/cli-config-test.js
  5. +2 −2 test/commands-test.js
View
@@ -23,7 +23,7 @@ At its core `flatiron-cli-config` is a broadway-compatible plugin which can be u
// Expose CLI commands using `flatiron-cli-config`
//
app.use(require('flatiron-cli-config'));
-
+
if (!module.parent) {
//
// Start the application
@@ -45,7 +45,7 @@ The output will be:
data: foo bar
```
-And the contents of `test-config.json` will be:
+And the contents of `test-config.json` will be:
```
{ "foo": "bar" }
@@ -59,7 +59,7 @@ And the contents of `test-config.json` will be:
$ node examples/app.js help config
help: `app.js config *` commands allow you to edit your
help: local app.js configuration file. Valid commands are:
- help:
+ help:
help: app.js config list
help: app.js config set <key> <value>
help: app.js config get <key>
@@ -73,13 +73,13 @@ And the contents of `test-config.json` will be:
//
// Name of the store in `app.config` to use for `config list`. [Default: all config]
//
- store: 'file'
-
+ store: 'file'
+
//
// Set of properties which cannot be deleted using `config delete <key>`
//
restricted: ['foo', 'bar'],
-
+
//
// Set of functions which will execute before named commands: get, set, list, delete
//
View
@@ -27,7 +27,7 @@ exports.usage = [
exports.set = function (key, value, callback) {
var args = Array.prototype.slice.call(arguments);
callback = args.pop();
-
+
if (args.length !== 2) {
cliConfig.app.log.error('You must pass both <key> and <value>');
return callback(true, true);
@@ -45,7 +45,7 @@ exports.set = function (key, value, callback) {
if (value === "false") {
value = false;
}
-
+
cliConfig.app.config.set(key, value);
cliConfig.app.config.save(callback);
};
@@ -74,7 +74,7 @@ exports.get = function (key, callback) {
else if (cliConfig.before.get && !cliConfig.before.get(key)) {
return callback();
}
-
+
var value = cliConfig.app.config.get(key);
if (!value) {
cliConfig.app.log.error('No configuration value for ' + key.yellow);
@@ -85,7 +85,7 @@ exports.get = function (key, callback) {
app.inspect.putObject(value);
return callback();
}
-
+
cliConfig.app.log.data([key.yellow, (value+'').magenta].join(' '));
callback();
};
@@ -126,7 +126,7 @@ exports.delete = function (key, callback) {
cliConfig.app.log.help('Use ' + (cliConfig.app.name || '<app>') + ' config set <key> <value>');
return callback();
}
-
+
cliConfig.app.config.clear(key);
cliConfig.app.config.save(callback);
};
@@ -149,18 +149,18 @@ exports.list = function (callback) {
var data = cliConfig.store
? cliConfig.app.config.stores[cliConfig.store].store
: cliConfig.app.config.load();
-
+
if (cliConfig.before.list && !cliConfig.before.list()) {
return callback();
}
-
+
cliConfig.app.inspect.putObject(data, {
password: function (line) {
var password = line.match(/password.*\:\s(.*)$/)[1];
return line.replace(password, "'********'");
}
}, 2);
-
+
callback();
};
View
@@ -1,5 +1,5 @@
/*
- * flatiron-cli-config.js: Top-level include for the `flatiron-cli-config` module.
+ * flatiron-cli-config.js: Top-level include for the `flatiron-cli-config` module.
*
* (C) 2010, Nodejitsu Inc.
*
@@ -23,21 +23,21 @@ cliConfig.name = 'cli-config';
cliConfig.attach = function (options) {
var app = this;
options = options || {};
-
+
if (!app.plugins.cli) {
throw new Error('`cli` plugin is required to use `flatiron-cli-config`');
}
else if (!app.config) {
throw new Error('`app.config` must be set to use `flatiron-cli-config`');
}
-
+
app.config.remove('literal');
cliConfig.app = app;
cliConfig.store = options.store || null;
cliConfig.restricted = options.restricted || [];
cliConfig.before = options.before || {};
common.templateUsage(app, cliConfig.commands);
-
+
app.commands['config'] = app.commands['config'] || {};
app.commands['config'] = common.mixin(app.commands['config'], cliConfig.commands);
app.alias('conf', { resource: 'config', command: 'list' });
@@ -49,12 +49,12 @@ cliConfig.attach = function (options) {
//
cliConfig.detach = function () {
var app = this;
-
+
Object.keys(app.commands['config']).forEach(function (method) {
if (cliConfig.commands[method]) {
delete app.commands['config'][method];
}
-
+
cliConfig.commands.app = null;
});
};
View
@@ -1,7 +1,7 @@
var assert = require('assert'),
vows = require('vows');
-
+
vows.describe('flatiron-cli-config').addBatch({
"When a flatiron plugin uses `flatiron-cli-config`": {
topic: require('../examples/app'),
View
@@ -39,6 +39,6 @@ cliEasy.describe('flatiron-cli-config/commands')
// REMARK: This syntax is really ackward
//
.expect('should indicate the setting has been deleted', '', /error/)
-
-
+
+
.export(module);

0 comments on commit dcb4b17

Please sign in to comment.