Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide more details when the command does not exist #2371

Open
pPrecel opened this issue Feb 26, 2025 · 1 comment
Open

Provide more details when the command does not exist #2371

pPrecel opened this issue Feb 26, 2025 · 1 comment
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@pPrecel
Copy link
Contributor

pPrecel commented Feb 26, 2025

Description

Users should be informed when a wrong command that does not exist is called (for example for an extension that is not installed)

Actual result

When we call the what-is-this command that doesn't exist we should be informed that this command is not found. Instead of this, we print help:

kyma@v3 alpha what-is-this
A set of alpha prototypes that may still change. Use in automations on your own risk

Usage:
  kyma alpha [command]

Available Commands:
  access             Produce a kubeconfig with Service Account based token and certificate
  app                Manage applications on Kubernetes cluster
  hana               Manage a Hana instance on the Kyma platform
  module             Manage kyma modules
  oidc               Create kubeconfig with an OIDC token
  provision          Provisions a Kyma cluster on the BTP
  reference-instance Add an instance reference to a shared service instance

Flags:
      --kubeconfig string       Path to the Kyma kubeconfig file
      --show-extensions-error   Print possible error when fetching extensions failed

Global Flags:
  -h, --help   Help for the command

Use "kyma alpha [command] --help" for more information about a command.

Expected result

kyma@v3 alpha what-is-this
unknown command "what-is-this" for "kyma alpha"
@pPrecel pPrecel added kind/enhancement kind/bug Categorizes issue or PR as related to a bug. and removed kind/enhancement labels Feb 26, 2025
@pPrecel pPrecel self-assigned this Feb 26, 2025
@pPrecel
Copy link
Contributor Author

pPrecel commented Feb 27, 2025

This is how cobra is working by default. After cobra owners fix this issue we can bump its dependency and everything should work fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

1 participant