From 5e7b2dec616b844dd881897727d0edceb90dfa85 Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Fri, 12 Oct 2018 12:12:20 +0200 Subject: Make id option overwrite XDS_xxx_ID env var The behavior must be the same when XDS_SDK_ID is defined and user set -id option or simply give an id without setting "--id" string option. IOW all following commands must give the exact same result (get info of sdk 9d69): ./bin/xds-cli sdks get -id 9d69 ./bin/xds-cli sdks get 9d69 XDS_SDK_ID=9d69 ./bin/xds-cli sdks get XDS_SDK_ID=1234 ./bin/xds-cli sdks get -id 9d69 XDS_SDK_ID=12345 ./bin/xds-cli sdks get 9d69 Change-Id: Idbd3f052df8172d56de98f827743b43d70d37393 Signed-off-by: Sebastien Douheret --- cmd-projects.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd-projects.go') diff --git a/cmd-projects.go b/cmd-projects.go index e056563..fd46d9a 100644 --- a/cmd-projects.go +++ b/cmd-projects.go @@ -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) } -- cgit 1.2.3-korg