X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=cmd-sdks.go;h=4bc5a738a7ee3f502dfb1dcebd41c196f896fdde;hb=7d1bcb1c9a48514e0e26246b86c8597502833b4b;hp=e140856371df3d3c5db4cc2b6f87c19ab2e02db4;hpb=36b8457bdd2e4fd222dec676988ffdf7f8e50f2f;p=src%2Fxds%2Fxds-cli.git diff --git a/cmd-sdks.go b/cmd-sdks.go index e140856..4bc5a73 100644 --- a/cmd-sdks.go +++ b/cmd-sdks.go @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 "IoT.bzh" + * Copyright (C) 2017-2018 "IoT.bzh" * Author Sebastien Douheret * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +23,7 @@ import ( "os" "regexp" - "github.com/iotbzh/xds-agent/lib/xaapiv1" + "gerrit.automotivelinux.org/gerrit/src/xds/xds-agent.git/lib/xaapiv1" "github.com/urfave/cli" ) @@ -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 {