some fixes around command textx

This commit is contained in:
Ben Hirschberg
2021-08-30 22:03:03 +03:00
parent 44803ab915
commit fc2374a690
3 changed files with 6 additions and 6 deletions
+3 -2
View File
@@ -12,6 +12,7 @@ import (
"kubescape/policyhandler"
"kubescape/printer"
"os"
"strings"
"github.com/spf13/cobra"
)
@@ -26,7 +27,7 @@ type CLIHandler struct {
var frameworkCmd = &cobra.Command{
Use: "framework <framework name>",
Short: "The framework you wish to use. Supported frameworks: nsa, mitre",
Short: fmt.Sprintf("The framework you wish to use. Supported frameworks: %s", strings.Join(supportedFrameworks, ", ")),
Long: ``,
ValidArgs: supportedFrameworks,
Args: func(cmd *cobra.Command, args []string) error {
@@ -34,7 +35,7 @@ var frameworkCmd = &cobra.Command{
return errors.New("requires at least one argument")
}
if !isValidFramework(args[0]) {
return errors.New("supported frameworks: nsa and mitre")
return errors.New(fmt.Sprintf("supported frameworks: %s", strings.Join(supportedFrameworks, ", ")))
}
return nil
},
+2 -3
View File
@@ -8,9 +8,8 @@ var cfgFile string
var rootCmd = &cobra.Command{
Use: "kubescape",
Short: "A tool for running NSA recommended tests in your cluster ",
Long: `Kubescape is the first tool for testing if Kubernetes is deployed securely as defined in Kubernetes Hardening Guidance
by to NSA and CISA Tests are configured with YAML files, making this tool easy to update as test specifications evolve.`,
Short: "Kubescape is a tool for testing Kubernetes security posture",
Long: `Kubescape is a tool for testing Kubernetes security posture based on NSA and MITRE specifications.`,
}
func Execute() {
+1 -1
View File
@@ -7,7 +7,7 @@ import (
// scanCmd represents the scan command
var scanCmd = &cobra.Command{
Use: "scan",
Short: "Scan the current running cluster or specified yaml files",
Short: "Scan the current running cluster or yaml files",
Long: `The action you want to perform`,
Run: func(cmd *cobra.Command, args []string) {
},