rickub/clipublic Fork 0
1a1d4302402433417a40905bf2e2a7b85504872e
Commits
Clone
git clone https://git.rickub.com/rickub/cli.git
git clone ssh://git@rickub.com/rickub/cli.git
Initial import of the rickub CLI as a standalone public project 1a1d430Unverified · on 1a1d4302402433417a40905bf2e2a7b85504872e · Olivier Girardot · 9h ago
main.go · 24 lines · 491 BGo Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Command rickub is the command-line interface to a rickub git host.
package main

import (
	"errors"
	"fmt"
	"os"

	"rickub.com/rickub/cli/cmd"
	"rickub.com/rickub/cli/internal/api"
)

func main() {
	if err := cmd.Execute(); err != nil {
		// Surface the API error envelope clearly on stderr.
		var apiErr *api.APIError
		if errors.As(err, &apiErr) {
			fmt.Fprintf(os.Stderr, "rickub: %s\n", apiErr.Error())
		} else {
			fmt.Fprintf(os.Stderr, "rickub: %s\n", err)
		}
		os.Exit(1)
	}
}