You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I have an application (call it myapp) which takes a variadic argument. For example, I can call the application with: myapp input1 input2. I would like to accept inputs from the stdin stream so that they could be redirected from a file. In this situation, given a file input.txt, like this:
input1 input2
Running the application via myapp < input.txt would run with the same result of myapp input1 input2. I realize this is a stretch but .. Is this possible somehow with click?
EDIT: realized this can be easily achieved with xargs or cat, e.g. xargs input.txt myapp. Thank you!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello. I have an application (call it
myapp
) which takes a variadic argument. For example, I can call the application with:myapp input1 input2
. I would like to accept inputs from the stdin stream so that they could be redirected from a file. In this situation, given a fileinput.txt
, like this:Running the application via
myapp < input.txt
would run with the same result ofmyapp input1 input2
. I realize this is a stretch but .. Is this possible somehow with click?EDIT: realized this can be easily achieved with
xargs
orcat
, e.g.xargs input.txt myapp
. Thank you!Beta Was this translation helpful? Give feedback.
All reactions