2020-05-15 09:39:16 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2022-10-13 10:28:24 +00:00
|
|
|
"github.com/spf13/cobra"
|
2020-05-15 09:39:16 +00:00
|
|
|
)
|
|
|
|
|
2024-02-22 10:04:36 +00:00
|
|
|
type cliConfig struct {
|
|
|
|
cfg configGetter
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewCLIConfig(cfg configGetter) *cliConfig {
|
|
|
|
return &cliConfig{
|
|
|
|
cfg: cfg,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (cli *cliConfig) NewCommand() *cobra.Command {
|
|
|
|
cmd := &cobra.Command{
|
2021-08-31 13:03:47 +00:00
|
|
|
Use: "config [command]",
|
|
|
|
Short: "Allows to view current config",
|
|
|
|
Args: cobra.ExactArgs(0),
|
|
|
|
DisableAutoGenTag: true,
|
2020-05-15 09:39:16 +00:00
|
|
|
}
|
2020-11-30 09:37:17 +00:00
|
|
|
|
2024-02-22 10:04:36 +00:00
|
|
|
cmd.AddCommand(cli.newShowCmd())
|
|
|
|
cmd.AddCommand(cli.newShowYAMLCmd())
|
|
|
|
cmd.AddCommand(cli.newBackupCmd())
|
|
|
|
cmd.AddCommand(cli.newRestoreCmd())
|
|
|
|
cmd.AddCommand(cli.newFeatureFlagsCmd())
|
2020-11-30 09:37:17 +00:00
|
|
|
|
2024-02-22 10:04:36 +00:00
|
|
|
return cmd
|
2020-05-15 09:39:16 +00:00
|
|
|
}
|