Input filenames instead of --stdin
See original GitHub issue--stdin
is rather inflexible in that it requires a shell or other means of piping data to the executable.
I’m proposing a --input-file
which works similarly but obsoletes --stdin
cat requirements.txt | safety --stdin
becomes safety -- requirements.txt
echo 'x==1' | safety --stdin
becomes echo 'x==1' | safety -- /dev/stdin
etc.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to replace part of a filename with input from stdin?
1 Answer 1 ; id; do my.command --input1 · ${id} · _1.gz --input2 ; -r id; do my.command --input1 · ${id} · _1.gz...
Read more >How can I provide stdin to ed, which need a filename?
Effectively, instead of 'piping' into ed, you can use 'process substitution' to pass the output of your command as the input to be...
Read more >(single hyphen) as a filename meaning "stdin" · Issue #998 ...
By Unix convention, if a tool accepts a filename as input, the filename - (a single hyphen) will be interpreted as "read from...
Read more >1. Using exec
An exec <filename command redirects stdin to a file. ... all stdin comes from that file, rather than its normal source (usually keyboard...
Read more >Section 6: Redirecting Input and Output
The standard input file provides a way to send data to a process. ... Many Unix commands that will accept a file name...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No,
-r
also tries to read referenced files.If you have a requirements.txt like this:
and you read that from stdin, you have no way to tell where
main.txt
is located.If you read in the file and have a file path, you can resolve
main.txt
and read that too.At least with unix tools, they strive to make things not have two-ways-to-do-things, the primary reason I opened this ticket 😃