Closed robotex82 closed 7 years ago
After some experimentation, I solved it like this:
in_stream = StringIO.new
in_stream.puts "username@example.com"
in_stream.puts "password"
in_stream.rewind
TTY::Command.new.run("my_cli_program", "login", in: in_stream).out
Added pull request #25
Hi Roberto,
Thanks for using the library.
This gem uses spawn
under the covers and hence supports all of its parameters see.
Hi,
I have a question regarding the input stream. Assume I have a cli program, that first asks for an email address and then asks for a password via STDIN. How can I handle this situation?
I tried something like this, but I am not able to split the input, so it inputs the email address first, and then the password.
Any clues?
Many thanks!
Best regards, Roberto