mise icon indicating copy to clipboard operation
mise copied to clipboard

`-y` to accept prompts in non interactive sessions

Open Hypnotist1148 opened this issue 2 years ago • 4 comments

At the moment I do it like this

rtx install myplugin@latest
rtx global myplugin@latest

But it would be nice to base able to this

rtx global myplugin@latest -y

Hypnotist1148 avatar Feb 23 '23 07:02 Hypnotist1148

just set RTX_MISSING_RUNTIME_BEHAVIOR=autoinstall

jdx avatar Feb 23 '23 13:02 jdx

I'd be open to making this a global flag. I don't like -y though. It's not clear what you're saying yes to, right now we only prompt for this one thing but we may add other things later. I think granular prompts would be better.

--missing-runtime-behavior=autoinstall is certainly a mouthful, but that might be the best option unless we want to consider changing this to something more concise. Another advantage of this is that it matches the setting and env var.

jdx avatar Feb 23 '23 20:02 jdx

True, something like --install-missing

Hypnotist1148 avatar Feb 24 '23 10:02 Hypnotist1148

it's actually an accident you were even able to pipe in "y". That was happening because I check if stderr is a tty, but not stdin. Note this prompt has also changed to multiselect so you should still be able to do that but you wouldn't need to pass "y" since everything defaults to enabled.

jdx avatar Feb 24 '23 13:02 jdx