Update .gitreview file
[src/xds/xds-cli.git] / cmd-sdks.go
index e4012e7..0005215 100644 (file)
@@ -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)
        }
@@ -187,7 +187,8 @@ func _displaySdks(sdks []xaapiv1.SDK, verbose bool, all bool, filter string) {
                        fmt.Fprintln(writer, "Version\t"+s.Version)
                        fmt.Fprintln(writer, "Status\t"+s.Status)
                        fmt.Fprintln(writer, "Path\t"+s.Path)
-                       fmt.Fprintln(writer, "Url\t"+s.URL)
+                       fmt.Fprintln(writer, "Url\t"+formatURL(s.URL))
+                       fmt.Fprintln(writer, "Image Url\t"+formatURL(s.ImageURL))
 
                } else {
                        if first {
@@ -226,7 +227,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 +327,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 +351,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)
        }
@@ -365,3 +366,10 @@ func sdksAbort(ctx *cli.Context) error {
        Log.Debugf("Result of %s: %v", url, newSdk)
        return nil
 }
+
+func formatURL(u string) string {
+       if u == "" {
+               return "-"
+       }
+       return u
+}