You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2013/07/11 23:50:36 UTC

[36/43] git commit: adding registry dependency and wiring up commands

adding registry dependency and wiring up commands


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/67ab4d3e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/67ab4d3e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/67ab4d3e

Branch: refs/heads/plugman-registry
Commit: 67ab4d3e790d032bc58f29a3e70aa97aa4de2b12
Parents: cd0a39e
Author: Anis Kadri <an...@gmail.com>
Authored: Thu Jun 13 18:21:27 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 14:07:52 2013 -0700

----------------------------------------------------------------------
 main.js | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/67ab4d3e/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index b7c5d54..3db0f6a 100755
--- a/main.js
+++ b/main.js
@@ -43,12 +43,9 @@ var known_opts = { 'platform' : [ 'ios', 'android', 'blackberry10', 'wp7', 'wp8'
         , 'link': Boolean
         , 'variable' : Array
         , 'www': path
-}, shortHands = { 'var' : 'variable' };
-var short_hands = {
-    "v": ["--version"]
-        , "h": ["--help"]
-}
-var cli_opts = nopt(known_opts, short_hands);
+}, shortHands = { 'var' : 'variable', 'v': 'version', 'h': 'help' };
+
+var cli_opts = nopt(known_opts, shortHands);
 
 // Default the plugins_dir to './cordova/plugins'.
 var plugins_dir;
@@ -83,7 +80,7 @@ else if (cli_opts.help) {
     console.log(plugman.help());
 }
 else if ((cli_opts.install || cli_opts.uninstall || cli_opts.argv.original.length == 0) && (!cli_opts.platform || !cli_opts.project || !cli_opts.plugin)) {
-    console.log(plugman.help());
+    plugman.help();
 }
 else if (cli_opts.uninstall) {
     plugman.uninstall(cli_opts.platform, cli_opts.project, cli_opts.plugin, plugins_dir, { www_dir: cli_opts.www });
@@ -116,5 +113,5 @@ subdir: '.',
     };
     plugman.install(cli_opts.platform, cli_opts.project, cli_opts.plugin, plugins_dir, opts);
 } else {
-    console.log(plugman.help());
+    plugman.help();
 }