blob: a85c0d045797d813171f8ac02c8193317063e9f3 [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
Tim Windelschmidtb6308cd2023-10-10 21:19:03 +020010 "source.monogon.dev/cloud/equinix/wrapngo"
Tim Windelschmidt886c3862023-05-23 16:47:41 +020011)
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}