The command curl https://idk/a.tar.gz | byteblitz a.tar.gz should firstly check if a.tar.gz exists. If it does, exit with an error, otherwise, write the input to the file and open it normally. Since stdin is now curl's output, for the user to be able to edit the file, the program needs to open the input of the terminal. This can be done by opening /dev/tty (since SUSv1). Checking if the input is a pipe can be done with this trait from rust's std.
Also, it should behave correctly when used alongside #15, as in curl https://idk/a.tar.gz | byteblitz hex /tmp/deletelater.tar.gz > hexadecimal.txt.
The command
curl https://idk/a.tar.gz | byteblitz a.tar.gz
should firstly check ifa.tar.gz
exists. If it does, exit with an error, otherwise, write the input to the file and open it normally. Sincestdin
is now curl's output, for the user to be able to edit the file, the program needs to open the input of the terminal. This can be done by opening/dev/tty
(since SUSv1). Checking if the input is a pipe can be done with this trait from rust's std.Also, it should behave correctly when used alongside #15, as in
curl https://idk/a.tar.gz | byteblitz hex /tmp/deletelater.tar.gz > hexadecimal.txt
.