Skip to content

Commit

Permalink
cscli refact: package clisupport
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Aug 28, 2024
1 parent e02b0dc commit a78b99c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package clisupport

import (
"archive/zip"
Expand Down Expand Up @@ -373,11 +373,13 @@ func (cli *cliSupport) dumpCrash(zw *zip.Writer) error {
return nil
}

type configGetter func() *csconfig.Config

type cliSupport struct {
cfg configGetter
}

func NewCLISupport(cfg configGetter) *cliSupport {
func New(cfg configGetter) *cliSupport {
return &cliSupport{
cfg: cfg,
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/crowdsec-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/crowdsecurity/crowdsec/cmd/crowdsec-cli/clipapi"
"github.com/crowdsecurity/crowdsec/cmd/crowdsec-cli/clisetup"
"github.com/crowdsecurity/crowdsec/cmd/crowdsec-cli/clisimulation"
"github.com/crowdsecurity/crowdsec/cmd/crowdsec-cli/clisupport"
"github.com/crowdsecurity/crowdsec/pkg/csconfig"
"github.com/crowdsecurity/crowdsec/pkg/fflag"
)
Expand Down Expand Up @@ -267,7 +268,7 @@ It is meant to allow you to manage bans, parsers/scenarios/etc, api and generall
cmd.AddCommand(cliexplain.New(cli.cfg, ConfigFilePath).NewCommand())
cmd.AddCommand(clihubtest.New(cli.cfg).NewCommand())
cmd.AddCommand(clinotifications.New(cli.cfg).NewCommand())
cmd.AddCommand(NewCLISupport(cli.cfg).NewCommand())
cmd.AddCommand(clisupport.New(cli.cfg).NewCommand())
cmd.AddCommand(clipapi.New(cli.cfg).NewCommand())
cmd.AddCommand(NewCLICollection(cli.cfg).NewCommand())
cmd.AddCommand(NewCLIParser(cli.cfg).NewCommand())
Expand Down

0 comments on commit a78b99c

Please sign in to comment.