github.com/crowdsecurity/crowdsec@v1.6.1/cmd/crowdsec-cli/config.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/spf13/cobra"
     5  )
     6  
     7  type cliConfig struct {
     8  	cfg configGetter
     9  }
    10  
    11  func NewCLIConfig(cfg configGetter) *cliConfig {
    12  	return &cliConfig{
    13  		cfg: cfg,
    14  	}
    15  }
    16  
    17  func (cli *cliConfig) NewCommand() *cobra.Command {
    18  	cmd := &cobra.Command{
    19  		Use:               "config [command]",
    20  		Short:             "Allows to view current config",
    21  		Args:              cobra.ExactArgs(0),
    22  		DisableAutoGenTag: true,
    23  	}
    24  
    25  	cmd.AddCommand(cli.newShowCmd())
    26  	cmd.AddCommand(cli.newShowYAMLCmd())
    27  	cmd.AddCommand(cli.newBackupCmd())
    28  	cmd.AddCommand(cli.newRestoreCmd())
    29  	cmd.AddCommand(cli.newFeatureFlagsCmd())
    30  
    31  	return cmd
    32  }