Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:wdavidw/node-shell

  • Loading branch information...
commit d4db430853dfef2bfcff11ad982da021f4cc766d 2 parents fa46e92 + 136f286
@wdavidw authored
Showing with 26 additions and 26 deletions.
  1. +26 −26 lib/plugins/completer.coffee
View
52 lib/plugins/completer.coffee
@@ -1,26 +1,26 @@
-
-###
-
-Completer plugin
-================
-
-Provides tab completion. Options passed during creation are:
-
-- `shell` , (required) A reference to your shell application.
-
-###
-module.exports = (settings) ->
- # Validation
- throw new Error 'No shell provided' if not settings.shell
- shell = settings.shell
- # Plug completer to interface
- return unless shell.isShell
- shell.interface().completer = (text) ->
- suggestions = []
- routes = shell.routes
- for route in routes
- command = route.command
- if command.substr(0, text.length) is text
- suggestions.push command
- [suggestions, text]
- null
+
+###
+
+Completer plugin
+================
+
+Provides tab completion. Options passed during creation are:
+
+- `shell` , (required) A reference to your shell application.
+
+###
+module.exports = (settings) ->
+ # Validation
+ throw new Error 'No shell provided' if not settings.shell
+ shell = settings.shell
+ # Plug completer to interface
+ return unless shell.isShell
+ shell.interface().completer = (text, cb) ->
+ suggestions = []
+ routes = shell.routes
+ for route in routes
+ command = route.command
+ if command.substr(0, text.length) is text
+ suggestions.push command
+ cb(false, [suggestions, text])
+ null
Please sign in to comment.
Something went wrong with that request. Please try again.