| Initial import of the rickub CLI as a standalone public project 1a1d430 Olivier Girardot 8h ago | 1 | // Command rickub is the command-line interface to a rickub git host. |
| 2 | package main |
| 3 | |
| 4 | import ( |
| 5 | "errors" |
| 6 | "fmt" |
| 7 | "os" |
| 8 | |
| 9 | "rickub.com/rickub/cli/cmd" |
| 10 | "rickub.com/rickub/cli/internal/api" |
| 11 | ) |
| 12 | |
| 13 | func main() { |
| 14 | if err := cmd.Execute(); err != nil { |
| 15 | // Surface the API error envelope clearly on stderr. |
| 16 | var apiErr *api.APIError |
| 17 | if errors.As(err, &apiErr) { |
| 18 | fmt.Fprintf(os.Stderr, "rickub: %s\n", apiErr.Error()) |
| 19 | } else { |
| 20 | fmt.Fprintf(os.Stderr, "rickub: %s\n", err) |
| 21 | } |
| 22 | os.Exit(1) |
| 23 | } |
| 24 | } |