Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/help.js')
-rw-r--r--lib/help.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/help.js b/lib/help.js
index db166b1b5..c554bed69 100644
--- a/lib/help.js
+++ b/lib/help.js
@@ -1,12 +1,24 @@
+module.exports = help
+
+help.completion = function (args, index, cb) {
+ if (index < 3) {
+ var getCompletions = require("./utils/completion/get-completions")
+ , section = args[0] || ""
+
+ getSections(function (er, sectionList) {
+ if (er) return cb(er)
+ cb(null, getCompletions(section, sectionList))
+ })
+ }
+}
+
var fs = require("./utils/graceful-fs")
, path = require("path")
, exec = require("./utils/exec")
, npm = require("../npm")
, output = require("./utils/output")
-module.exports = help
-
function help (args, cb) {
var section = args.shift()
if (section === "help") {