Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(completion): allow to get completions for any string, not just p…
…rocess.argv (#470) * feat(completion): allow to get completions for any string, not just `process.argv` Add new method `.getCompletion(args, done)` which receives an array of strings representing a line to complete, and calls the `done` callback with the resulting completions. Update the completion tests to pass the arguments explicitly to yargs. We can't pass them by mocking `process.argv` now because `process.argv` is only checked on `index.js`, which is called before the tests can apply the mock. * Fix indentation * Fix indentation * docs(completion): document .getCompletion() method
- Loading branch information
Showing
4 changed files
with
89 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters