blob: 92245981531ddad361f31564b36dc0f75230dfc5 [file] [log] [blame]
Lorenz Brun6adf8842021-10-05 13:39:11 +02001package main
2
3import (
4 "github.com/spf13/cobra"
5)
6
7// rootCmd represents the base command when called without any subcommands
8var rootCmd = &cobra.Command{
9 Use: "metroctl",
10 Short: "metroctl controls Metropolis nodes and clusters.",
11}
12
Mateusz Zalegad5f2f7a2022-07-05 18:48:56 +020013type metroctlFlags struct {
14 // clusterEndpoints is a list of the targeted cluster's endpoints, used by
15 // commands that perform RPC on it.
16 clusterEndpoints []string
Mateusz Zalegaf7774962022-07-08 12:26:55 +020017 // proxyAddr is a SOCKS5 proxy address the cluster will be accessed through.
18 proxyAddr string
Mateusz Zalegad5f2f7a2022-07-05 18:48:56 +020019}
20
21var flags metroctlFlags
22
23func init() {
24 rootCmd.PersistentFlags().StringArrayVar(&flags.clusterEndpoints, "endpoints", nil, "A list of the target cluster's endpoints.")
Mateusz Zalegaf7774962022-07-08 12:26:55 +020025 rootCmd.PersistentFlags().StringVar(&flags.proxyAddr, "proxy", "", "SOCKS5 proxy address")
Mateusz Zalegad5f2f7a2022-07-05 18:48:56 +020026}
27
Lorenz Brun6adf8842021-10-05 13:39:11 +020028func main() {
29 cobra.CheckErr(rootCmd.Execute())
30}