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

[Feature request] Config hr default text # through environment variable #60

Open
NNBnh opened this issue Feb 27, 2021 · 2 comments
Open

Comments

@NNBnh
Copy link

NNBnh commented Feb 27, 2021

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 hr (SuperB HR), a portable posix shell hr.

@LuRsT
Copy link
Owner

LuRsT commented Apr 2, 2021

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: hr looks awesome! I love the logo 😃

@NNBnh
Copy link
Author

NNBnh commented Apr 3, 2021

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

Yeah, string make more sense than text.

PS: hr looks awesome! I love the logo 😃

Thank you :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants