crowdsec/cmd/crowdsec-cli/config.go

33 lines
629 B
Go
Raw Permalink Normal View History

2020-05-15 09:39:16 +00:00
package main
import (
"github.com/spf13/cobra"
2020-05-15 09:39:16 +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{
Use: "config [command]",
Short: "Allows to view current config",
Args: cobra.ExactArgs(0),
DisableAutoGenTag: true,
2020-05-15 09:39:16 +00:00
}
cmd.AddCommand(cli.newShowCmd())
cmd.AddCommand(cli.newShowYAMLCmd())
cmd.AddCommand(cli.newBackupCmd())
cmd.AddCommand(cli.newRestoreCmd())
cmd.AddCommand(cli.newFeatureFlagsCmd())
return cmd
2020-05-15 09:39:16 +00:00
}