Allow list and rm as alternatives.

`remove` was specified in full, while `ls` was used in a short form.
This allows `rm` and `remove` to be used interchangeably, and `ls` and
`list` to be used interchangeably so that there's no confusion of
expectations.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/commit/38f180fc
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/tree/38f180fc
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/diff/38f180fc

Branch: refs/heads/cordova-client
Commit: 38f180fc6a20ec2919393b56362e04b835c53e3a
Parents: 01324a7
Author: Darryl Pogue <dvpdin...@gmail.com>
Authored: Tue Oct 2 22:21:46 2012 -0700
Committer: Darryl Pogue <dvpdin...@gmail.com>
Committed: Tue Oct 2 22:21:46 2012 -0700

----------------------------------------------------------------------
 src/platform.js |    4 +++-
 src/plugin.js   |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/38f180fc/src/platform.js
----------------------------------------------------------------------
diff --git a/src/platform.js b/src/platform.js
index 652a2ba..305caf6 100644
--- a/src/platform.js
+++ b/src/platform.js
@@ -21,6 +21,7 @@ module.exports = function platform(command, target, callback) 
{
 
     switch(command) {
         case 'ls':
+        case 'list':
             return fs.readdirSync(path.join(projectRoot, 'platforms'));
             break;
         case 'add':
@@ -65,10 +66,11 @@ module.exports = function platform(command, target, 
callback) {
                     break;
             }
             break;
+        case 'rm':
         case 'remove':
             shell.rm('-rf', path.join(projectRoot, 'platforms', target));
             break;
         default:
-            throw ('Unrecognized command "' + command + '". Use either `add`, 
`remove`, or `ls`.');
+            throw ('Unrecognized command "' + command + '". Use either `add`, 
`remove`, or `list`.');
     }
 };

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/38f180fc/src/plugin.js
----------------------------------------------------------------------
diff --git a/src/plugin.js b/src/plugin.js
index d5a86b1..9cedfdd 100644
--- a/src/plugin.js
+++ b/src/plugin.js
@@ -35,6 +35,7 @@ module.exports = function plugin(command, target, callback) {
 
     switch(command) {
         case 'ls':
+        case 'list':
             if (plugins.length) {
                 return plugins;
             } else return 'No plugins added. Use `cordova plugin add 
<plugin>`.';
@@ -100,6 +101,7 @@ module.exports = function plugin(command, target, callback) 
{
 
             if (callback) callback();
             break;
+        case 'rm':
         case 'remove':
             if (platforms.length === 0) {
                 throw 'You need at least one platform added to your app. Use 
`cordova platform add <platform>`.';
@@ -148,6 +150,6 @@ module.exports = function plugin(command, target, callback) 
{
             }
             break;
         default:
-            throw 'Unrecognized command "' + command + '". Use either `add`, 
`remove`, or `ls`.';
+            throw 'Unrecognized command "' + command + '". Use either `add`, 
`remove`, or `list`.';
     }
 };

Reply via email to