canonical / jhack

Chock-full of Juju hackery.
Apache License 2.0
51 stars 24 forks source link

jhack nuke must ask for confirmation #34

Closed beliaev-maksim closed 1 year ago

beliaev-maksim commented 1 year ago

if jhack nuke is called without arguments it must ask for confirmation instead of blindly deleting

PietroPasotti commented 1 year ago

That was a design choice, and is documented. Do you think it's counterintuitive? Or just dangerous?

beliaev-maksim commented 1 year ago

I would say just dangerous

We don't need it to be like in juju with model name Even yes/no question, with default YES will be fine

Then user at least sees the name of the model

PietroPasotti commented 1 year ago

wouldn't then one assume that also passing an argument would ask for confirmation? I'd find it odd that jhack nuke a --> nukes all models starting with 'a', including the current one if it does, without asking.

beliaev-maksim commented 1 year ago

I would expect only full match should go without a prompt

all the rest should go like: nuke A* Would you like to nuke models A, Alpha, Android ? [Y/n]

PietroPasotti commented 1 year ago

Mmm, I'll think about it. What I really liked about nuke (and the whole point) is that it's fast and furious: if you want to destroy stuff the careful way, just use the proper juju command. But maybe adding a configurable toplevel confirmation isn't a bad idea either.

beliaev-maksim commented 1 year ago

In this case you just hit Enter twice, should not be a huge burden