diff --git a/cmd/cli/kubectl-kyverno/jp/function/function.go b/cmd/cli/kubectl-kyverno/jp/function/function.go index f3c19e6887..c2eb6c78d2 100644 --- a/cmd/cli/kubectl-kyverno/jp/function/function.go +++ b/cmd/cli/kubectl-kyverno/jp/function/function.go @@ -23,7 +23,8 @@ var examples = []string{ func Command() *cobra.Command { return &cobra.Command{ Use: "function [function_name]...", - Short: strings.Join(description, "\n"), + Short: description[0], + Long: strings.Join(description, "\n"), Example: strings.Join(examples, "\n\n"), SilenceUsage: true, Run: func(cmd *cobra.Command, args []string) { diff --git a/cmd/cli/kubectl-kyverno/jp/jp.go b/cmd/cli/kubectl-kyverno/jp/jp.go index 54789d89ab..af5d0f4d10 100644 --- a/cmd/cli/kubectl-kyverno/jp/jp.go +++ b/cmd/cli/kubectl-kyverno/jp/jp.go @@ -1,17 +1,24 @@ package jp import ( + "strings" + "github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/jp/function" "github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/jp/parse" "github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/jp/query" "github.com/spf13/cobra" ) +var description = []string{ + "Provides a command-line interface to JMESPath, enhanced with Kyverno specific custom functions.", + "For more information visit: https://kyverno.io/docs/writing-policies/jmespath/.", +} + func Command() *cobra.Command { cmd := &cobra.Command{ - Use: "jp", - Short: `Provides a command-line interface to JMESPath, enhanced with Kyverno specific custom functions. - For more information visit: https://kyverno.io/docs/writing-policies/jmespath/.`, + Use: "jp", + Short: description[0], + Long: strings.Join(description, "\n"), RunE: func(cmd *cobra.Command, args []string) error { return cmd.Help() }, diff --git a/cmd/cli/kubectl-kyverno/jp/parse/parse.go b/cmd/cli/kubectl-kyverno/jp/parse/parse.go index a31f0a22a9..9642d63cb0 100644 --- a/cmd/cli/kubectl-kyverno/jp/parse/parse.go +++ b/cmd/cli/kubectl-kyverno/jp/parse/parse.go @@ -28,7 +28,8 @@ func Command() *cobra.Command { var files []string cmd := &cobra.Command{ Use: "parse [-f file|expression]...", - Short: strings.Join(description, "\n"), + Short: description[0], + Long: strings.Join(description, "\n"), Example: strings.Join(examples, "\n\n"), SilenceUsage: true, RunE: func(cmd *cobra.Command, args []string) error { diff --git a/cmd/cli/kubectl-kyverno/jp/query/query.go b/cmd/cli/kubectl-kyverno/jp/query/query.go index 1140fb612b..cb8d684e1f 100644 --- a/cmd/cli/kubectl-kyverno/jp/query/query.go +++ b/cmd/cli/kubectl-kyverno/jp/query/query.go @@ -35,7 +35,8 @@ func Command() *cobra.Command { var queries []string cmd := &cobra.Command{ Use: "query [-i input] [-q query|query]...", - Short: strings.Join(description, "\n"), + Short: description[0], + Long: strings.Join(description, "\n"), SilenceUsage: true, Example: strings.Join(examples, "\n\n"), RunE: func(cmd *cobra.Command, args []string) error {