summaryrefslogtreecommitdiffstats
path: root/cmd-sdks.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-10-12 12:12:20 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-10-12 12:12:20 +0200
commit5e7b2dec616b844dd881897727d0edceb90dfa85 (patch)
treed418ad897ef512fd811c9b5eece3e458b9f329b2 /cmd-sdks.go
parent35586adb40790f6b0b15c43d4bae86d29090736a (diff)
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 <sebastien.douheret@iot.bzh>
Diffstat (limited to 'cmd-sdks.go')
-rw-r--r--cmd-sdks.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd-sdks.go b/cmd-sdks.go
index e4012e7..35b053e 100644
--- a/cmd-sdks.go
+++ b/cmd-sdks.go
@@ -142,7 +142,7 @@ func sdksList(ctx *cli.Context) error {
}
func sdksGet(ctx *cli.Context) error {
- id := GetID(ctx)
+ id := GetID(ctx, "XDS_SDK_ID")
if id == "" {
return cli.NewExitError("id parameter or option must be set", 1)
}
@@ -226,7 +226,7 @@ func _sdksListGet(sdks *[]xaapiv1.SDK) error {
}
func sdksInstall(ctx *cli.Context) error {
- id := GetID(ctx)
+ id := GetID(ctx, "XDS_SDK_ID")
file := ctx.String("file")
force := ctx.Bool("force")
shortOut := ctx.Bool("short")
@@ -326,7 +326,7 @@ func sdksInstall(ctx *cli.Context) error {
}
func sdksUnInstall(ctx *cli.Context) error {
- id := GetID(ctx)
+ id := GetID(ctx, "XDS_SDK_ID")
if id == "" {
return cli.NewExitError("id parameter or option must be set", 1)
}
@@ -350,7 +350,7 @@ func sdksUnInstall(ctx *cli.Context) error {
}
func sdksAbort(ctx *cli.Context) error {
- id := GetID(ctx)
+ id := GetID(ctx, "XDS_SDK_ID")
if id == "" {
return cli.NewExitError("id parameter or option must be set", 1)
}