2023-12-07 11:21:04 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/crowdsecurity/crowdsec/pkg/cwhub"
|
|
|
|
)
|
|
|
|
|
2024-04-24 08:05:55 +00:00
|
|
|
func NewCLIParser(cfg configGetter) *cliItem {
|
2023-12-11 09:32:54 +00:00
|
|
|
return &cliItem{
|
2024-04-24 08:05:55 +00:00
|
|
|
cfg: cfg,
|
2023-12-07 11:21:04 +00:00
|
|
|
name: cwhub.PARSERS,
|
|
|
|
singular: "parser",
|
|
|
|
oneOrMore: "parser(s)",
|
|
|
|
help: cliHelp{
|
|
|
|
example: `cscli parsers list -a
|
|
|
|
cscli parsers install crowdsecurity/caddy-logs crowdsecurity/sshd-logs
|
|
|
|
cscli parsers inspect crowdsecurity/caddy-logs crowdsecurity/sshd-logs
|
|
|
|
cscli parsers upgrade crowdsecurity/caddy-logs crowdsecurity/sshd-logs
|
|
|
|
cscli parsers remove crowdsecurity/caddy-logs crowdsecurity/sshd-logs
|
|
|
|
`,
|
|
|
|
},
|
|
|
|
installHelp: cliHelp{
|
|
|
|
example: `cscli parsers install crowdsecurity/caddy-logs crowdsecurity/sshd-logs`,
|
|
|
|
},
|
|
|
|
removeHelp: cliHelp{
|
|
|
|
example: `cscli parsers remove crowdsecurity/caddy-logs crowdsecurity/sshd-logs`,
|
|
|
|
},
|
|
|
|
upgradeHelp: cliHelp{
|
|
|
|
example: `cscli parsers upgrade crowdsecurity/caddy-logs crowdsecurity/sshd-logs`,
|
|
|
|
},
|
|
|
|
inspectHelp: cliHelp{
|
|
|
|
example: `cscli parsers inspect crowdsecurity/httpd-logs crowdsecurity/sshd-logs`,
|
|
|
|
},
|
|
|
|
listHelp: cliHelp{
|
|
|
|
example: `cscli parsers list
|
|
|
|
cscli parsers list -a
|
|
|
|
cscli parsers list crowdsecurity/caddy-logs crowdsecurity/sshd-logs
|
|
|
|
|
|
|
|
List only enabled parsers unless "-a" or names are specified.`,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|