Make id option overwrite XDS_xxx_ID env var
[src/xds/xds-cli.git] / cmd-projects.go
index e056563..fd46d9a 100644 (file)
@@ -130,7 +130,7 @@ func projectsList(ctx *cli.Context) error {
 }
 
 func projectsGet(ctx *cli.Context) error {
-       id := GetID(ctx)
+       id := GetID(ctx, "XDS_PROJECT_ID")
        if id == "" {
                return cli.NewExitError("id parameter or option must be set", 1)
        }
@@ -216,7 +216,7 @@ func projectsAdd(ctx *cli.Context) error {
 
 func projectsRemove(ctx *cli.Context) error {
        var res xaapiv1.ProjectConfig
-       id := GetID(ctx)
+       id := GetID(ctx, "XDS_PROJECT_ID")
        if id == "" {
                return cli.NewExitError("id parameter or option must be set", 1)
        }
@@ -236,7 +236,7 @@ func projectsRemove(ctx *cli.Context) error {
 }
 
 func projectsSync(ctx *cli.Context) error {
-       id := GetID(ctx)
+       id := GetID(ctx, "XDS_PROJECT_ID")
        if id == "" {
                return cli.NewExitError("id parameter or option must be set", 1)
        }