Closed tejing1 closed 2 years ago
I think that's a great idea, @tejing1. -f
seems to be a common choice for the short option, and I'm thinking either --from
or --file
as the long counterpart.
awk --file
sed --file
jq --from-file
--file
is probably the least surprising long option name.
Not sure what other tools to compare against off the top of my head.
Yeah, ripgrep uses --file
as well. I didn't like it at first because I felt --from
is a bit more explicit, but I will change it for consistency.
The -f
/ --file
option is available in hred@1.5.0
. Thanks for the suggestion!
You're welcome, and thanks for the super quick response. Not to mention for making my personal favorite tool in this category. :smile:
I've found myself writing
hred "$(<filename)"
somewhat frequently, as queries are often just a little too large to ergonomically inline in a script.Most major text stream processing tools with their own domain specific language, like
jq
,sed
, andawk
, can be invoked asprog -f filename
instead ofprog 'dsl code'
, so it would make sense forhred
to have the same functionality.