mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-15 22:04:03 +02:00
* add hub type "context" * cscli lapi: log.Fatal -> fmt.Errorf; lint * tests for context.yaml * load console context from hub * original & compiled context * deprecate "cscli lapi context delete" $ cscli lapi context delete Command "delete" is deprecated, please manually edit the context file. * cscli completion: add appsec-rules, appsec-configs, explain, hubtest
40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"github.com/crowdsecurity/crowdsec/pkg/cwhub"
|
|
)
|
|
|
|
func NewContextCLI() *itemCLI {
|
|
return &itemCLI{
|
|
name: cwhub.CONTEXTS,
|
|
singular: "context",
|
|
oneOrMore: "context(s)",
|
|
help: cliHelp{
|
|
example: `cscli contexts list -a
|
|
cscli contexts install crowdsecurity/yyy crowdsecurity/zzz
|
|
cscli contexts inspect crowdsecurity/yyy crowdsecurity/zzz
|
|
cscli contexts upgrade crowdsecurity/yyy crowdsecurity/zzz
|
|
cscli contexts remove crowdsecurity/yyy crowdsecurity/zzz
|
|
`,
|
|
},
|
|
installHelp: cliHelp{
|
|
example: `cscli contexts install crowdsecurity/yyy crowdsecurity/zzz`,
|
|
},
|
|
removeHelp: cliHelp{
|
|
example: `cscli contexts remove crowdsecurity/yyy crowdsecurity/zzz`,
|
|
},
|
|
upgradeHelp: cliHelp{
|
|
example: `cscli contexts upgrade crowdsecurity/yyy crowdsecurity/zzz`,
|
|
},
|
|
inspectHelp: cliHelp{
|
|
example: `cscli contexts inspect crowdsecurity/yyy crowdsecurity/zzz`,
|
|
},
|
|
listHelp: cliHelp{
|
|
example: `cscli contexts list
|
|
cscli contexts list -a
|
|
cscli contexts list crowdsecurity/yyy crowdsecurity/zzz
|
|
|
|
List only enabled contexts unless "-a" or names are specified.`,
|
|
},
|
|
}
|
|
}
|