diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-01-05 00:44:24 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-01-05 00:44:28 +0100 |
commit | f2b2c900fcc8f02a5e532794772ed5359618c3cc (patch) | |
tree | 5bad4e13885bab6a8fbc327144ae1462875fdaa9 /cmd-projects.go | |
parent | 36b8457bdd2e4fd222dec676988ffdf7f8e50f2f (diff) |
Add confirmation before deleting a project or a sdk.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'cmd-projects.go')
-rw-r--r-- | cmd-projects.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd-projects.go b/cmd-projects.go index 6e7241a..713e3f8 100644 --- a/cmd-projects.go +++ b/cmd-projects.go @@ -92,6 +92,10 @@ func initCmdProjects(cmdDef *[]cli.Command) { Usage: "project id", EnvVar: "XDS_PROJECT_ID", }, + cli.BoolFlag{ + Name: "force, f", + Usage: "remove confirmation prompt before removal", + }, }, }, { @@ -209,6 +213,12 @@ func projectsRemove(ctx *cli.Context) error { return cli.NewExitError("id parameter or option must be set", 1) } + if !ctx.Bool("force") { + if !Confirm("Do you permanently remove project id '" + id + "' [yes/No] ? ") { + return nil + } + } + if err := HTTPCli.Delete("/projects/"+id, &res); err != nil { return cli.NewExitError(err, 1) } |