blob: b4fe1dd6e2b345bbb2a3c1caa763e2edb2374129 [file] [log] [blame]
Tim Windelschmidt886c3862023-05-23 16:47:41 +02001package main
2
3import (
4 "flag"
5
6 "github.com/spf13/cobra"
7
Tim Windelschmidt4264b8c2023-06-12 23:54:58 +02008 "k8s.io/klog/v2"
Tim Windelschmidt886c3862023-05-23 16:47:41 +02009
10 "source.monogon.dev/cloud/shepherd/equinix/wrapngo"
11)
12
13// rootCmd represents the base command when called without any subcommands
14var rootCmd = &cobra.Command{
15 PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
16 if c.APIKey == "" || c.User == "" {
17 klog.Exitf("-equinix_api_username and -equinix_api_key must be set")
18 }
19 return nil
20 },
21}
22
23var c wrapngo.Opts
24
25func init() {
26 c.RegisterFlags()
27 rootCmd.PersistentFlags().AddGoFlagSet(flag.CommandLine)
28}
29
30func main() {
31 cobra.CheckErr(rootCmd.Execute())
32}