(cmd *cobra.Command, args []string)
| 25 | } |
| 26 | |
| 27 | func focusBlockRun(cmd *cobra.Command, args []string) (rtnErr error) { |
| 28 | defer func() { |
| 29 | sendActivity("focusblock", rtnErr == nil) |
| 30 | }() |
| 31 | |
| 32 | tabId := os.Getenv("WAVETERM_TABID") |
| 33 | if tabId == "" { |
| 34 | return fmt.Errorf("no tab id specified (set WAVETERM_TABID environment variable)") |
| 35 | } |
| 36 | |
| 37 | fullORef, err := resolveBlockArg() |
| 38 | if err != nil { |
| 39 | return err |
| 40 | } |
| 41 | |
| 42 | route := fmt.Sprintf("tab:%s", tabId) |
| 43 | err = wshclient.SetBlockFocusCommand(RpcClient, fullORef.OID, &wshrpc.RpcOpts{ |
| 44 | Route: route, |
| 45 | Timeout: 2000, |
| 46 | }) |
| 47 | if err != nil { |
| 48 | return fmt.Errorf("focusing block: %v", err) |
| 49 | } |
| 50 | return nil |
| 51 | } |
nothing calls this directly
no test coverage detected