| 1 | // SPDX-License-Identifier: AGPL-3.0-or-later |
| 2 | |
| 3 | package main |
| 4 | |
| 5 | import ( |
| 6 | "fmt" |
| 7 | "os" |
| 8 | |
| 9 | "github.com/spf13/cobra" |
| 10 | ) |
| 11 | |
| 12 | var rootCmd = &cobra.Command{ |
| 13 | Use: "shithubd-runner", |
| 14 | Short: "Run shithub Actions jobs on a Docker or Podman host", |
| 15 | SilenceUsage: true, |
| 16 | SilenceErrors: true, |
| 17 | } |
| 18 | |
| 19 | func Execute() { |
| 20 | if err := rootCmd.Execute(); err != nil { |
| 21 | fmt.Fprintln(os.Stderr, "shithubd-runner:", err) |
| 22 | os.Exit(1) |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | func init() { |
| 27 | rootCmd.AddCommand(runCmd) |
| 28 | rootCmd.AddCommand(versionCmd) |
| 29 | } |
| 30 |