Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read from stdin by default #275

Open
mrnoname1000 opened this issue Feb 27, 2024 · 2 comments
Open

Read from stdin by default #275

mrnoname1000 opened this issue Feb 27, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@mrnoname1000
Copy link

Having to specify -f - when using trurl in a pipeline is a little clunky. IMO if no URLs are provided on the command line, trurl should behave as if -f - was passed. This would streamline the usage of trurl in a pipeline and make it behave more like a Unix text-processing utility. It also has the benefit of not changing any existing behavior except error handling.

@jacobmealey
Copy link
Contributor

jacobmealey commented Apr 21, 2024

Okay, I worked through implementing this (twice actually lol) and @emanuele6 pointed out a flaws with this. manually specifying -f - avoids a lot of weird edge cases in shell scripts where stdin has already been redirected that would require tacking on a < /dev/null. see #288 discussion for more details. @bagder can we close this issue?

@mrnoname1000
Copy link
Author

I would argue that behavior is correct, since almost every other text processing utility behaves that way, e.g. cat "$@" or sed 's/foo/bar/' "$@" (without checking for a tty I might add).

However, it sounds like this would be a major, breaking change to trurl. I'd be fine closing this issue but I'd like to highlight #274 which would somewhat mitigate my gripes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants