question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jayfkcommented, Nov 8, 2016

No, -r also tries to read referenced files.

If you have a requirements.txt like this:

django=1.2.3
-r main.txt

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.

0reactions
asottilecommented, Nov 8, 2016

At least with unix tools, they strive to make things not have two-ways-to-do-things, the primary reason I opened this ticket 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found