copyToClipboard copies text to the system clipboard
(text string)
| 189 | |
| 190 | // copyToClipboard copies text to the system clipboard |
| 191 | func copyToClipboard(text string) error { |
| 192 | var cmd *exec.Cmd |
| 193 | |
| 194 | switch runtime.GOOS { |
| 195 | case "darwin": |
| 196 | cmd = exec.Command("pbcopy") |
| 197 | case "linux": |
| 198 | cmd = exec.Command("xclip", "-selection", "clipboard") |
| 199 | case "windows": |
| 200 | cmd = exec.Command("clip") |
| 201 | default: |
| 202 | return fmt.Errorf("unsupported platform") |
| 203 | } |
| 204 | |
| 205 | cmd.Stdin = strings.NewReader(text) |
| 206 | return cmd.Run() |
| 207 | } |
| 208 | |
| 209 | // RequiredAPIs lists all APIs that might be needed by the CLI |
| 210 | var RequiredAPIs = map[string]string{ |
no outgoing calls
no test coverage detected