MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / workspaceListRun

Function workspaceListRun

cmd/wsh/cmd/wshcmd-workspace.go:30–51  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

28}
29
30func 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}

Callers

nothing calls this directly

Calls 3

WorkspaceListCommandFunction · 0.92
WriteStderrFunction · 0.85
WriteStdoutFunction · 0.85

Tested by

no test coverage detected