Open PgBiel opened 7 months ago
Thanks, @PgBiel, those are some great ideas.
For my thoughts about the future of this library, check https://github.com/tynanbe/shellout/issues/5#issuecomment-1969342494
As for stdin
, shellout
should already be as transparent as possible about it, meaning it should be possible to pipe stdin to a command already in many cases. In other words, LetBeStdin
shouldn't be necessary, but Erlang itself has some limitations with stdin
, as I recall. Potentially in the future, I'll provide a NIF (possibly with a number of precompiled binaries available) I've been toying with that has solved my previous frustrations with Erlang.
I'll definitely consider your other suggestions when I start working on shellout
v2.0.
For the time being, I think your first and third ideas might be currently doable as, e.g.
shellout.command(run: "sh", with: ["-euc", "
echo '" <> my_string <> "' \\
| cat
"], in: ".", opt: [LetBeStderr, LetBeStdout])
Hello, Thanks for the great library! I'm new to Gleam, and this seems very useful to program abstractions around shell commands and such.
I'd like to ask, are there any plans for tools to work with
stdin
? In particular:stdin
received by the Gleam program to the input of the program being run (something akin toLetBeStdin
);stdout
to another program'sstdin
in an efficient manner (could be platform-restricted if needed). This could require a deeper rework (to e.g. use some sort ofProcess
type), but I still think that could be very handy when working with e.g. lots of data in the shell.Thanks in advance!