blob: 85de18b9b214126928922dc6c02552c0ac8e6554 [file] [log] [blame]
Tim Windelschmidt6d33a432025-02-04 14:34:25 +01001// Copyright The Monogon Project Authors.
2// SPDX-License-Identifier: Apache-2.0
3
Tim Windelschmidt886c3862023-05-23 16:47:41 +02004package main
5
6import (
7 "flag"
8
9 "github.com/spf13/cobra"
10
Tim Windelschmidt4264b8c2023-06-12 23:54:58 +020011 "k8s.io/klog/v2"
Tim Windelschmidt886c3862023-05-23 16:47:41 +020012
Tim Windelschmidtb6308cd2023-10-10 21:19:03 +020013 "source.monogon.dev/cloud/equinix/wrapngo"
Tim Windelschmidt886c3862023-05-23 16:47:41 +020014)
15
16// rootCmd represents the base command when called without any subcommands
17var rootCmd = &cobra.Command{
18 PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
19 if c.APIKey == "" || c.User == "" {
20 klog.Exitf("-equinix_api_username and -equinix_api_key must be set")
21 }
22 return nil
23 },
24}
25
26var c wrapngo.Opts
27
28func init() {
29 c.RegisterFlags()
30 rootCmd.PersistentFlags().AddGoFlagSet(flag.CommandLine)
31}
32
33func main() {
34 cobra.CheckErr(rootCmd.Execute())
35}