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:42 UTC
[42/43] git commit: fixing help
fixing help
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/93acf395
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/93acf395
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/93acf395
Branch: refs/heads/plugman-registry
Commit: 93acf395f85f892e3e394884ff69a6e14bd2e264
Parents: 330baef
Author: Anis Kadri <an...@apache.org>
Authored: Thu Jul 11 14:34:16 2013 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Jul 11 14:34:16 2013 -0700
----------------------------------------------------------------------
main.js | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/93acf395/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 1f7bea5..cd16733 100755
--- a/main.js
+++ b/main.js
@@ -42,7 +42,7 @@ var known_opts = { 'platform' : [ 'ios', 'android', 'blackberry10', 'wp7', 'wp8'
, 'link': Boolean
, 'variable' : Array
, 'www': path
-}, shortHands = { 'var' : 'variable', 'v': 'version', 'h': 'help' };
+}, shortHands = { 'var' : ['--variable'], 'v': ['--version'], 'h': ['--help'] };
var cli_opts = nopt(known_opts, shortHands);
@@ -71,15 +71,14 @@ if (cli_opts.debug) {
}
plugman.on('warn', console.warn);
plugman.on('error', console.error);
-
if (cli_opts.version) {
console.log(package.name + ' version ' + package.version);
}
else if (cli_opts.help) {
- plugman.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)) {
- plugman.help();
+ console.log(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 });
@@ -112,5 +111,5 @@ subdir: '.',
};
plugman.install(cli_opts.platform, cli_opts.project, cli_opts.plugin, plugins_dir, opts);
} else {
- plugman.help();
+ console.log(plugman.help());
}