feature: add -a option for which command#655
Merged
nfischer merged 4 commits intoshelljs:masterfrom Feb 10, 2017
termosa:master
Merged
feature: add -a option for which command#655nfischer merged 4 commits intoshelljs:masterfrom termosa:master
nfischer merged 4 commits intoshelljs:masterfrom
termosa:master
Conversation
nfischer
requested changes
Feb 8, 2017
Member
nfischer
left a comment
There was a problem hiding this comment.
Looks pretty good! I have a couple questions:
- What gets returned if you get
which('-a', 'alskdfjalskdfj')? - Could we add a test that verifies the first result is always the same as
which()(no options) would produce?
test/which.js
Outdated
| const result = shell.which('-a', 'node'); | ||
| t.falsy(shell.error()); | ||
| t.truthy(result); | ||
| t.truthy(result.length); |
Member
There was a problem hiding this comment.
Can you check that result[0] === shell.which('node')?
Contributor
Author
There was a problem hiding this comment.
@nfischer this is a good idea. I'll get it done.
Contributor
Author
|
@nfischer hi!
So let me know what do you think about |
This was referenced Feb 10, 2017
Member
|
LGTM. I'll merge after CI passes |
Contributor
Author
|
Thank you, I'll be waiting for release. |
Member
|
I think we can make a v0.7.x release for this |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With a
-aoption it will return an array of all matched binaries. Stdout is formatted as needed (joined with\nall binaries and\nis added to the end).I've tested it on Mac OSX and Windows.