Code Review
/
src
/
xds
/
xds-cli.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
List "Installing" sdks by default.
[src/xds/xds-cli.git]
/
cmd-projects.go
diff --git
a/cmd-projects.go
b/cmd-projects.go
index
13a7126
..
fc4bc22
100644
(file)
--- 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 <sebastien@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Author Sebastien Douheret <sebastien@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@
-22,7
+22,7
@@
import (
"fmt"
"strings"
"fmt"
"strings"
- "g
ithub.com/iotbzh/xds-agen
t/lib/xaapiv1"
+ "g
errit.automotivelinux.org/gerrit/src/xds/xds-agent.gi
t/lib/xaapiv1"
"github.com/urfave/cli"
)
"github.com/urfave/cli"
)
@@
-63,8
+63,9
@@
func initCmdProjects(cmdDef *[]cli.Command) {
Action: projectsGet,
Flags: []cli.Flag{
cli.StringFlag{
Action: projectsGet,
Flags: []cli.Flag{
cli.StringFlag{
- Name: "id",
- Usage: "project id",
+ Name: "id",
+ Usage: "project id",
+ EnvVar: "XDS_PROJECT_ID",
},
},
},
},
},
},
@@
-87,8
+88,13
@@
func initCmdProjects(cmdDef *[]cli.Command) {
Action: projectsRemove,
Flags: []cli.Flag{
cli.StringFlag{
Action: projectsRemove,
Flags: []cli.Flag{
cli.StringFlag{
- Name: "id",
- Usage: "project id",
+ Name: "id",
+ Usage: "project id",
+ EnvVar: "XDS_PROJECT_ID",
+ },
+ cli.BoolFlag{
+ Name: "force, f",
+ Usage: "remove confirmation prompt before removal",
},
},
},
},
},
},
@@
-99,8
+105,9
@@
func initCmdProjects(cmdDef *[]cli.Command) {
Action: projectsSync,
Flags: []cli.Flag{
cli.StringFlag{
Action: projectsSync,
Flags: []cli.Flag{
cli.StringFlag{
- Name: "id",
- Usage: "project id",
+ Name: "id",
+ Usage: "project id",
+ EnvVar: "XDS_PROJECT_ID",
},
},
},
},
},
},
@@
-206,6
+213,12
@@
func projectsRemove(ctx *cli.Context) error {
return cli.NewExitError("id parameter or option must be set", 1)
}
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)
}
if err := HTTPCli.Delete("/projects/"+id, &res); err != nil {
return cli.NewExitError(err, 1)
}