allow several args for ban add reason
This commit is contained in:
parent
b2b34075e9
commit
d6ad758128
1 changed files with 6 additions and 4 deletions
|
@ -216,9 +216,10 @@ cscli ban add range 1.2.3.0/24 24h "the whole range"`,
|
|||
Short: "Adds the specific ip to the ban db",
|
||||
Long: `Duration must be [time.ParseDuration](https://golang.org/pkg/time/#ParseDuration), expressed in s/m/h.`,
|
||||
Example: `cscli ban add ip 1.2.3.4 12h "the scan"`,
|
||||
Args: cobra.ExactArgs(3),
|
||||
Args: cobra.MinimumNArgs(3),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if err := BanAdd(args[0], args[1], args[2], remediationType); err != nil {
|
||||
reason := strings.Join(args[2:], " ")
|
||||
if err := BanAdd(args[0], args[1], reason, remediationType); err != nil {
|
||||
log.Fatalf("failed to add ban to sqlite : %v", err)
|
||||
}
|
||||
},
|
||||
|
@ -229,9 +230,10 @@ cscli ban add range 1.2.3.0/24 24h "the whole range"`,
|
|||
Short: "Adds the specific ip to the ban db",
|
||||
Long: `Duration must be [time.ParseDuration](https://golang.org/pkg/time/#ParseDuration) compatible, expressed in s/m/h.`,
|
||||
Example: `cscli ban add range 1.2.3.0/24 12h "the whole range"`,
|
||||
Args: cobra.ExactArgs(3),
|
||||
Args: cobra.MinimumNArgs(3),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if err := BanAdd(args[0], args[1], args[2], remediationType); err != nil {
|
||||
reason := strings.Join(args[2:], " ")
|
||||
if err := BanAdd(args[0], args[1], reason, remediationType); err != nil {
|
||||
log.Fatalf("failed to add ban to sqlite : %v", err)
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue