-
Notifications
You must be signed in to change notification settings - Fork 6
Add the ability to specify stdin to pass to a sub-command. #64
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
Conversation
//! * `stdin: <string>`, text to be passed to the command's `stdin`. If the command exits without | ||
//! having consumed all of `<string>`, an error will be raised. Note, though, that operating | ||
//! system file buffers can mean that the command *appears* to have consumed all of `<string>` | ||
//! without it actually having done so. |
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.
E.g. You have a bunch of newlines in your input string?
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.
The problem is even simpler than that: the OS and/or filesystem library might buffer input. So we might write to the pipe, see that the input has disappeared, and assume that it was read by the command; but the input might be in an intermediate buffer and the program can exit without ever actually having read it. I'm not aware that we can do anything about this.
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.
That matches my interpretation of the docstring.
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.
Ah I understand. Thanks!
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.
Cool feature. I can see this being useful. LGTM with the caveat that I'm not too familiar with the poll syscall.
Oops, forgot to add @vext01 to this. |
LGTM |
OK, so it sounds like we can merge? |
There's one outstanding comment from Jake, so I'll let him do the merge once he's happy. |
@vext01 I think we might want to, and be able to, go ahead with this one. Please have a look at my reply to Jake's question and see if you think it's been addressed or not. |
bors r+ |
Build succeeded: |
4: Use lang_tester r=vext01 a=ltratt Needs #3 and softdevteam/lang_tester#64 to be merged first (and a new release of lang_tester to be made). Co-authored-by: Laurence Tratt <laurie@tratt.net>
4: Use lang_tester r=vext01 a=ltratt Needs #3 and softdevteam/lang_tester#64 to be merged first (and a new release of lang_tester to be made). Co-authored-by: Laurence Tratt <laurie@tratt.net>
No description provided.