hr
hr copied to clipboard
[Feature request] Config hr default text `#` through environment variable
Hello, I think the option to customize the default text (when running hr
without argument) via environment variable will be a nice feature:
export HR_DEFAULT_TEXT="<text>"
I suggest using HR_DEFAULT_TEXT
instead of HR_DEFAULT_WORD
like from the code:
hrs() { local WORD for WORD in "${@:-#}" do hr "$WORD" done }
because if (by some reason) we type:
hr 'The quick brown fox jumps over the lazy dog'
then it is definitely not a word :(
BTW, thank you for inspiring me to create (SuperB HR), a portable posix shell
hr
.
Hey @NNBnh,
Thank you so much for taking the time to suggest this feature! I don't understand in which context would it help to have it, is it in a scenario where you're running hr
multiple times and want to have a different output for all those calls are there other advantages to having it do that?
As for the use of WORD
I totally agree, it should be text
like you suggest or even string
, but I'd only change it if I touch the code again to add a new feature, or fix something.
PS: looks awesome! I love the logo :smiley:
Hi @LuRsT,
Thank you so much for taking the time to suggest this feature! I don't understand in which context would it help to have it, is it in a scenario where you're running
hr
multiple times and want to have a different output for all those calls are there other advantages to having it do that?
I thinks this feature is just for convention. without create an alias: hr="hr ${@-DEFAULT_TEXT_}"
, user can type:
$ hr
DEFAULT_TEXT_DEFAULT_TEXT_DEFAULT_TEXT_
which is shorter than:
$ hr "DEFAULT_TEXT_"
DEFAULT_TEXT_DEFAULT_TEXT_DEFAULT_TEXT_
As for the use of
WORD
I totally agree, it should betext
like you suggest or evenstring
, but I'd only change it if I touch the code again to add a new feature, or fix something.
Yeah, string
make more sense than text
.
PS:
looks awesome! I love the logo 😃
Thank you :D