aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/lib/utils/usage.js
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2016-05-06 15:22:02 -0700
committerJeremiah Senkpiel <fishrock123@rocketmail.com>2016-05-10 14:45:28 -0400
commit5c36cfc8438d28ee5050ee6d5c383cf9c5b895fb (patch)
tree6165b1b2ee92982a1e157ac29c924b516771780d /deps/npm/lib/utils/usage.js
parent101dd1ed789175311ab22f9a32dfc480f127bc68 (diff)
downloadandroid-node-v8-5c36cfc8438d28ee5050ee6d5c383cf9c5b895fb.tar.gz
android-node-v8-5c36cfc8438d28ee5050ee6d5c383cf9c5b895fb.tar.bz2
android-node-v8-5c36cfc8438d28ee5050ee6d5c383cf9c5b895fb.zip
deps: upgrade npm to 3.8.9
Contains the following three npm releases: https://github.com/npm/npm/releases/tag/v3.8.7 https://github.com/npm/npm/releases/tag/v3.8.8 https://github.com/npm/npm/releases/tag/v3.8.9 PR-URL: https://github.com/nodejs/node/pull/6664 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'deps/npm/lib/utils/usage.js')
-rw-r--r--deps/npm/lib/utils/usage.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/deps/npm/lib/utils/usage.js b/deps/npm/lib/utils/usage.js
new file mode 100644
index 0000000000..261d84ee8e
--- /dev/null
+++ b/deps/npm/lib/utils/usage.js
@@ -0,0 +1,27 @@
+'use strict'
+var aliases = require('../config/cmd-list').aliases
+
+module.exports = function usage (cmd, txt, opt) {
+ var post = Object.keys(aliases).reduce(function (p, c) {
+ var val = aliases[c]
+ if (val !== cmd) return p
+ return p.concat(c)
+ }, [])
+
+ if (opt || post.length > 0) txt += '\n\n'
+
+ if (post.length === 1) {
+ txt += 'aliase: '
+ txt += post.join(', ')
+ } else if (post.length > 1) {
+ txt += 'aliases: '
+ txt += post.join(', ')
+ }
+
+ if (opt) {
+ if (post.length > 0) txt += '\n'
+ txt += 'common options: ' + opt
+ }
+
+ return txt
+}