completion
Advanced tools
+2
-0
| # completion changelog | ||
| 1.0.1 - Rearranged documentation to make it more straightforward | ||
| 1.0.0 - Reworked data structure to support options | ||
@@ -3,0 +5,0 @@ |
+1
-1
| { | ||
| "name": "completion", | ||
| "description": "Completion library for CLI commands", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "homepage": "https://github.com/twolfson/completion", | ||
@@ -6,0 +6,0 @@ "author": { |
+13
-11
@@ -90,8 +90,19 @@ # completion [](https://travis-ci.org/twolfson/completion) | ||
| - If no `completion` is specified, we assume this is terminal and stop recursing | ||
| - Details on completion functions can be found below | ||
| - More info is available in the [`commands/option completion` section][command-completion-section] | ||
| - commands `Object[]` - Optional array of new `tree` instances to complete against | ||
| - This cannot exist on the same node as `completion` as they are contradictory | ||
| - completion `Function` - Optional completion function to determine results for a command | ||
| - Details on completion can be found below | ||
| - More info is available in the [`commands/option completion` section][command-completion-section] | ||
| [command-completion-section]: #commandoption-completion-functions | ||
| #### `completion.complete(params, cb)` | ||
| Get potential completion matches for given parameters | ||
| - params `Object` - Information similar to that passed in by `bash's` tab completion | ||
| - line `String` - Input to complete against (similar to `COMP_LINE`) | ||
| - cursor `Number` - Index within `line` of the cursor (similar to `COMP_POINT`) | ||
| - cb `Function` - Error-first callback function that receives matches | ||
| - `cb` should have a signature of `function (err, results)` | ||
| #### `command/option completion` functions | ||
@@ -149,11 +160,2 @@ `options` and `commands` share a common completion function signature, `function (info, cb)` | ||
| #### `completion.complete(params, cb)` | ||
| Get potential completion matches for given parameters | ||
| - params `Object` - Information similar to that passed in by `bash's` tab completion | ||
| - line `String` - Input to complete against (similar to `COMP_LINE`) | ||
| - cursor `Number` - Index within `line` of the cursor (similar to `COMP_POINT`) | ||
| - cb `Function` - Error-first callback function that receives matches | ||
| - `cb` should have a signature of `function (err, results)` | ||
| #### `completion.resolveInfo(info, cb)` | ||
@@ -160,0 +162,0 @@ Recursively find matches against the `Completion's tree` with a given `info` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
29102
0.81%241
0.84%0
-100%