Skip to content

Error Message Should Not Also Display Help Message #183

@danielhelfand

Description

@danielhelfand

Currently, when an error occurs, the user sees the error message returned and below that message is shown the --help output for the command that produced the error.

It's a bit overwhelming to get all of the information from --help when the user is not expecting it, and it also makes it difficult to find the error message.

I am proposing in this issue that the Tekton CLI simply return the error message instead of information from --help. An alternative that would allow the user to make the choice to see all of the information from --help would be to suggest to run --help with the command that was run.

Expected Behavior

When an error occurs, a user should simply receive the error message.

Actual Behavior

The user receives the error message and also receives information from --help.

Steps to Reproduce the Problem

  1. Run tkn pr ls -n and don't give -n a name argument
  2. See the output from the command:
tkn pr ls -n 
Error: flag needs an argument: 'n' in -n
Usage:
  tkn pipelinerun list [flags]

Aliases:
  list, ls

Examples:

# List all PipelineRuns of Pipeline name 'foo'
tkn pipelinerun list foo -n bar

# List all pipelineruns in a namespaces 'foo'
tkn pr list -n foo",


Flags:
      --allow-missing-template-keys   If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. (default true)
  -h, --help                          help for list
  -o, --output string                 Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file.
      --template string               Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].

Global Flags:
  -k, --kubeconfig string   kubectl config file (default: $HOME/.kube/config)
  -n, --namespace string    namespace to use (default: from $KUBECONFIG)

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions