Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(completion): allow to get completions for any string, not just process.argv #470

Merged
merged 4 commits into from May 1, 2016

Conversation

elas7
Copy link
Member

@elas7 elas7 commented Apr 8, 2016

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.

elas7 and others added 2 commits April 7, 2016 23:52
…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.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 7bce252 on elas7:feat-completion into a977ed7 on yargs:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 56fca63 on elas7:feat-completion into a977ed7 on yargs:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 23bfd63 on elas7:feat-completion into a977ed7 on yargs:master.

@bcoe
Copy link
Member

bcoe commented Apr 10, 2016

@elas7 this is great, this should address @abelnation's request in #335?

@elas7
Copy link
Member Author

elas7 commented Apr 11, 2016

@bcoe that´s right, it addresses #335

@bcoe bcoe merged commit 74fcfbc into yargs:master May 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants