X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=cmd-projects.go;h=fc4bc2272e3561c96221477aeadc4815b82d0afe;hb=7d1bcb1c9a48514e0e26246b86c8597502833b4b;hp=6e7241ababdd2c82a01f9e64e9f811c167055433;hpb=db05ee6a19f75e6fabaf8e6af09926edae554bc2;p=src%2Fxds%2Fxds-cli.git diff --git a/cmd-projects.go b/cmd-projects.go index 6e7241a..fc4bc22 100644 --- a/cmd-projects.go +++ b/cmd-projects.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"); @@ -22,7 +22,7 @@ import ( "fmt" "strings" - "github.com/iotbzh/xds-agent/lib/xaapiv1" + "gerrit.automotivelinux.org/gerrit/src/xds/xds-agent.git/lib/xaapiv1" "github.com/urfave/cli" ) @@ -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) }