Skip to content

skupper completion subcommand throws errors into stdout #2135

@hash-d

Description

@hash-d

Describe the bug

On failure, the completion subcommand prints the error and usage to stdout, instead of stderr.

It also does not return a non-zero exit code.

How To Reproduce

Just issue an invalid completion command, such as missing the shell specification

$ skupper completion 2> /dev/null
Generate the autocompletion script for skupper for the specified shell.
See each sub-command's help for details on how to use the generated script.

Usage:
  skupper completion [command]

Available Commands:
  bash        Generate the autocompletion script for bash
  fish        Generate the autocompletion script for fish
  powershell  Generate the autocompletion script for powershell
  zsh         Generate the autocompletion script for zsh

Flags:
  -h, --help   help for completion

Global Flags:
  -c, --context string      Set the kubeconfig context
      --kubeconfig string   Path to the kubeconfig file to use
  -n, --namespace string    Set the namespace
  -p, --platform string     Set the platform type to use [kubernetes, podman, docker, linux]

Use "skupper completion [command] --help" for more information about a command.
$ echo $?
0

Expected behavior

The error message should go to stderr. This is specially important for this subcommand, as its output is consumed by the shell.

The exit code should be non-zero, too, in case of failures.

Environment details

  • Skupper CLI: 2.0
  • Skupper Operator (if applicable): N/A
  • Platform: N/A

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcliIssues associated with the CLIv2issue for v2 Skupper version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions