Code Monkey home page Code Monkey logo

Comments (3)

JochenABC avatar JochenABC commented on June 6, 2024

Maybe list the resource you are deleting (like command output) first and then ask for confirmation?

Add a flag -y (--yes) to skip asking for confirmation and assume yes.

from cli.

thcyron avatar thcyron commented on June 6, 2024

Now that itβ€˜s possible to protect resources from accidental deletion on API level, I consider this to no longer be necessary.

from cli.

perlun avatar perlun commented on June 6, 2024

@thcyron As a fairly new user of hcloud and the Hetzner cloud, I think this could be reopened. Consider this:

$ hcloud server delete some-server

Even if the server is powered on, the API & CLI will happily delete this server without further notice. I think this is a bit overly zealous. Especially if you have done this previously in the same terminal and just press "Up" arrow and Enter without thinking, it can be quite fatal... πŸ˜…

We could consider doing what Docker Machine does: prompt by default:

$ docker-machine rm foo
About to remove foo
WARNING: This action will delete both local reference and remote instance.
Are you sure? (y/n): ^C

...and if -f or -y is specified, remove the machine without further ado:

$ docker-machine rm -f foo
About to remove foo
WARNING: This action will delete both local reference and remote instance.
Error removing host "foo": Docker machine "foo" does not exist. Use "docker-machine ls" to list machines. Use "docker-machine create" to add a new one.
Can't remove "foo"

I think an -f parameter would make most sense in our case. How about this: if the machine is powered off, no prompting/safety belt, but if the machine is running, ask for confirmation before removal (unless -f is specified)? πŸ€”

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.