aboutsummaryrefslogtreecommitdiffstats
path: root/cmd-sdks.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-01-05 00:44:24 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-01-05 00:44:28 +0100
commitf2b2c900fcc8f02a5e532794772ed5359618c3cc (patch)
tree5bad4e13885bab6a8fbc327144ae1462875fdaa9 /cmd-sdks.go
parent36b8457bdd2e4fd222dec676988ffdf7f8e50f2f (diff)
Add confirmation before deleting a project or a sdk.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'cmd-sdks.go')
-rw-r--r--cmd-sdks.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd-sdks.go b/cmd-sdks.go
index e140856..f34d8b1 100644
--- a/cmd-sdks.go
+++ b/cmd-sdks.go
@@ -102,6 +102,10 @@ func initCmdSdks(cmdDef *[]cli.Command) {
Usage: "sdk id to un-install",
EnvVar: "XDS_SDK_ID",
},
+ cli.BoolFlag{
+ Name: "force, f",
+ Usage: "remove confirmation prompt before removal",
+ },
},
},
{
@@ -289,6 +293,12 @@ func sdksUnInstall(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 SDK id '" + id + "' [yes/No] ? ") {
+ return nil
+ }
+ }
+
delSdk := xaapiv1.SDK{}
url := XdsServerComputeURL("/sdks/" + id)
if err := HTTPCli.Delete(url, &delSdk); err != nil {