remove unnecessary help message (#1152)

Signed-off-by: Arghya Sadhu <arghya88@gmail.com>
This commit is contained in:
Arghya Sadhu 2020-11-30 16:05:36 +05:30 committed by GitHub
parent cc6c7216d2
commit 3da89001a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 13 deletions

View File

@ -17,6 +17,10 @@
|=== |===
| | Description | PR | | Description | PR
| 🐣
| Removes unnecessary help message introduced for machine-readable outputs for commands which does not have -o url flag
| https://github.com/knative/client/pull/1152[#1152]
| 🐣 | 🐣
| Improve error handling in clients | Improve error handling in clients
| https://github.com/knative/client/pull/1154[#1154] | https://github.com/knative/client/pull/1154[#1154]

View File

@ -18,11 +18,10 @@ import (
"errors" "errors"
"fmt" "fmt"
"sort" "sort"
"strings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/cli-runtime/pkg/genericclioptions"
v1alpha2 "knative.dev/eventing/pkg/apis/sources/v1alpha2" "knative.dev/eventing/pkg/apis/sources/v1alpha2"
"knative.dev/client/lib/printing" "knative.dev/client/lib/printing"
"knative.dev/client/pkg/kn/commands" "knative.dev/client/pkg/kn/commands"
@ -114,7 +113,6 @@ func NewAPIServerDescribeCommand(p *commands.KnParams) *cobra.Command {
commands.AddNamespaceFlags(flags, false) commands.AddNamespaceFlags(flags, false)
flags.BoolP("verbose", "v", false, "More output.") flags.BoolP("verbose", "v", false, "More output.")
machineReadablePrintFlags.AddFlags(command) machineReadablePrintFlags.AddFlags(command)
command.Flag("output").Usage = fmt.Sprintf("Output format. One of: %s.", strings.Join(machineReadablePrintFlags.AllowedFormats(), "|"))
return command return command
} }

View File

@ -16,9 +16,7 @@ package ping
import ( import (
"errors" "errors"
"fmt"
"sort" "sort"
"strings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/cli-runtime/pkg/genericclioptions"
@ -113,7 +111,6 @@ func NewPingDescribeCommand(p *commands.KnParams) *cobra.Command {
commands.AddNamespaceFlags(flags, false) commands.AddNamespaceFlags(flags, false)
flags.BoolP("verbose", "v", false, "More output.") flags.BoolP("verbose", "v", false, "More output.")
machineReadablePrintFlags.AddFlags(command) machineReadablePrintFlags.AddFlags(command)
command.Flag("output").Usage = fmt.Sprintf("Output format. One of: %s.", strings.Join(machineReadablePrintFlags.AllowedFormats(), "|"))
return command return command
} }

View File

@ -16,18 +16,14 @@ package trigger
import ( import (
"errors" "errors"
"fmt"
"strings"
"k8s.io/cli-runtime/pkg/genericclioptions"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
v1beta1 "knative.dev/eventing/pkg/apis/eventing/v1beta1"
"knative.dev/client/lib/printing" "knative.dev/client/lib/printing"
"knative.dev/client/pkg/kn/commands" "knative.dev/client/pkg/kn/commands"
"knative.dev/client/pkg/printers" "knative.dev/client/pkg/printers"
"knative.dev/eventing/pkg/apis/eventing/v1beta1"
) )
var describeExample = ` var describeExample = `
@ -114,7 +110,6 @@ func NewTriggerDescribeCommand(p *commands.KnParams) *cobra.Command {
commands.AddNamespaceFlags(flags, false) commands.AddNamespaceFlags(flags, false)
flags.BoolP("verbose", "v", false, "More output.") flags.BoolP("verbose", "v", false, "More output.")
machineReadablePrintFlags.AddFlags(command) machineReadablePrintFlags.AddFlags(command)
command.Flag("output").Usage = fmt.Sprintf("Output format. One of: %s.", strings.Join(machineReadablePrintFlags.AllowedFormats(), "|"))
return command return command
} }