mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
return 1 with incomplete command line; always check error when calling cmd.Help (#1335)
This commit is contained in:
parent
4e6b9597f8
commit
aca37a38e7
8 changed files with 62 additions and 22 deletions
|
@ -20,10 +20,18 @@ import (
|
|||
dto "github.com/prometheus/client_model/go"
|
||||
"github.com/prometheus/prom2json"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/mod/semver"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
func printHelp(cmd *cobra.Command) {
|
||||
err := cmd.Help()
|
||||
if err != nil {
|
||||
log.Fatalf("uname to print help(): %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
func inSlice(s string, slice []string) bool {
|
||||
for _, str := range slice {
|
||||
if s == str {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue