1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-29 10:55:05 +00:00

fix cli output adjustments (#5787)

Signed-off-by: cleverhu <shouping.hu@daocloud.io>

Signed-off-by: cleverhu <shouping.hu@daocloud.io>
This commit is contained in:
cleverhu 2022-12-27 22:46:01 +08:00 committed by GitHub
parent c3ab0687bb
commit 0edff469ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 14 deletions

View file

@ -155,7 +155,7 @@ func Command() *cobra.Command {
applyCommandConfig := &ApplyCommandConfig{}
cmd = &cobra.Command{
Use: "apply",
Short: "applies policies on resources",
Short: "Applies policies on resources.",
Example: applyHelp,
RunE: func(cmd *cobra.Command, policyPaths []string) (err error) {
defer func() {

View file

@ -1,23 +1,17 @@
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: strings.Join(description, "\n"),
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/.`,
RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help()
},

View file

@ -49,8 +49,8 @@ func annotations(policy kyvernov1.PolicyInterface) map[string]string {
func Command() *cobra.Command {
cmd := &cobra.Command{
Use: "oci",
Long: `This command is one of the supported experimental commands, and its behaviour might be changed any time`,
Short: "pulls/pushes images that include policie(s) from/to OCI registries",
Long: `This command is one of the supported experimental commands, and its behaviour might be changed any time.`,
Short: "Pulls/pushes images that include policie(s) from/to OCI registries.",
Example: "",
RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help()

View file

@ -169,7 +169,7 @@ func Command() *cobra.Command {
cmd = &cobra.Command{
Use: "test <path_to_folder_Containing_test.yamls> [flags]\n kyverno test <path_to_gitRepository_with_dir> --git-branch <branchName>\n kyverno test --manifest-mutate > kyverno-test.yaml\n kyverno test --manifest-validate > kyverno-test.yaml",
// Args: cobra.ExactArgs(1),
Short: "run tests from directory",
Short: "Run tests from directory.",
Long: longHelp,
Example: exampleHelp,
RunE: func(cmd *cobra.Command, dirPath []string) (err error) {

View file

@ -11,7 +11,7 @@ import (
func Command() *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Shows current version of kyverno",
Short: "Shows current version of kyverno.",
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Printf("Version: %s\n", version.BuildVersion)
fmt.Printf("Time: %s\n", version.BuildTime)