mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
* cscsli: remove unused Command.Args setting * cscli: review/update argument number checking cscli will consistently print the help text if the number of arguments is wrong for the command, but not for other types of errors. * fix func tests * lint
28 lines
630 B
Go
28 lines
630 B
Go
package cliconfig
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/crowdsecurity/crowdsec/cmd/crowdsec-cli/args"
|
|
)
|
|
|
|
func (cli *cliConfig) showYAML(mergedConfig string) error {
|
|
fmt.Println(mergedConfig)
|
|
return nil
|
|
}
|
|
|
|
func (cli *cliConfig) newShowYAMLCmd(mergedConfigGetter mergedConfigGetter) *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "show-yaml",
|
|
Short: "Displays merged config.yaml + config.yaml.local",
|
|
Args: args.NoArgs,
|
|
DisableAutoGenTag: true,
|
|
RunE: func(_ *cobra.Command, _ []string) error {
|
|
return cli.showYAML(mergedConfigGetter())
|
|
},
|
|
}
|
|
|
|
return cmd
|
|
}
|