(cmd *cobra.Command, args []string)
| 28 | } |
| 29 | |
| 30 | func workspaceListRun(cmd *cobra.Command, args []string) { |
| 31 | workspaces, err := wshclient.WorkspaceListCommand(RpcClient, &wshrpc.RpcOpts{Timeout: 2000}) |
| 32 | if err != nil { |
| 33 | WriteStderr("Unable to list workspaces: %v\n", err) |
| 34 | return |
| 35 | } |
| 36 | |
| 37 | WriteStdout("[\n") |
| 38 | for i, w := range workspaces { |
| 39 | WriteStdout(" {\n \"windowId\": \"%s\",\n", w.WindowId) |
| 40 | WriteStderr(" \"workspaceId\": \"%s\",\n", w.WorkspaceData.OID) |
| 41 | WriteStdout(" \"name\": \"%s\",\n", w.WorkspaceData.Name) |
| 42 | WriteStdout(" \"icon\": \"%s\",\n", w.WorkspaceData.Icon) |
| 43 | WriteStdout(" \"color\": \"%s\"\n", w.WorkspaceData.Color) |
| 44 | if i < len(workspaces)-1 { |
| 45 | WriteStdout(" },\n") |
| 46 | } else { |
| 47 | WriteStdout(" }\n") |
| 48 | } |
| 49 | } |
| 50 | WriteStdout("]\n") |
| 51 | } |
nothing calls this directly
no test coverage detected