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.
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: allow stdin for sfdx-url #886
feat: allow stdin for sfdx-url #886
Changes from 10 commits
76e2ccc
24cf4b9
a50fc02
7c4b5fa
dba0e4b
3089130
0d83459
76b5250
010509c
5302946
a532ed1
0454ec9
7c34fc6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add this to both
sfdx-url-file
andsfdx-url-stdin
to ensure that people provide one of thoseDoing that would allow you to drop the validation logic you have on lines 88-96
We should also add
exclusive: ['sfdx-url-stdin']
to make sure that people don't provide bothThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdonnalley I added these suggestions but kept the validation logic, otherwise I get a compiler error that
sfdxAuthUrl
could be undefined. I think that's because its not smart enough to know that one of the flags are guaranteed to be provided. Let me know if you know a work-around, but I think that's consistent with other implementations.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@k-capehart I think
exclusive
is implied inexactlyOne
so there's not actually a need for both - you only needexactlyOne
on both flagsSorry about that - should have tested it all out before asking you to make a change!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdonnalley Oh makes sense, that explains the repetition in error messages I was seeing. I removed it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add
exclusive: ['sfdx-url-file']
to make sure that people don't provide bothThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdonnalley, question: It sounds to me like
--sfdx-url-stdin
can take only one value (-
), and if it's present then the user is doing the piping-through-stdin thing. So wouldn't it make more sense to make--sfdx-url-stdin
a Boolean flag? Or maybe I'm missing something.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can provide some context, this is what I based the solution on: oclif/core#761 (comment)
In this case, the value should always be
-
but that is consistent with CLI standards because oclif requires the-
value in order to read from standard input.