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

No error message for failed install command #525

Closed
1 of 2 tasks
YuviGold opened this issue Sep 24, 2021 · 4 comments
Closed
1 of 2 tasks

No error message for failed install command #525

YuviGold opened this issue Sep 24, 2021 · 4 comments

Comments

@YuviGold
Copy link
Contributor

No error message when trying to install a non existing app.

Expected Behaviour

  1. Display an error message to the user.
  2. Suggest available applications using levenshtein distance. Cobra does that for the root-level commands but not for nested commands
  3. In case the application is available for get command, suggest to use it. For example when using arkade install kind the user most definitely intended to get it and not to install it on top of a cluster.

Current Behaviour

No error message is shown at all and the returned exit code is 0.

$ arkade install bla
$ echo $?           
0

Are you a GitHub Sponsor (Yes/No?)

Check at https://github.com/sponsors/alexellis

  • Yes
  • No

Possible Solution

It seems cli/cli implemented the suggestions themselves. I would expect cobra to support it though.
https://github.com/cli/cli/blob/029d49f3b38ebd54cd84b23732bb7efabfce4896/pkg/cmd/root/help.go#L51-L76

Steps to Reproduce (for bugs)

  1. arkade install kind

Context

I was trying to get stuff and mistakenly used install command instead of get. Afterwards I noticed that install doesn't return any error message to the user to inform him of his mistake.

Your Environment

  • What Kubernetes distribution are you using?
kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.3", GitCommit:"2e7996e3e2712684bc73f0dec0200d64eec7fe40", GitTreeState:"clean", BuildDate:"2020-05-20T12:52:00Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.1", GitCommit:"5e58841cce77d4bc13713ad2b91fa0d961e69192", GitTreeState:"clean", BuildDate:"2021-05-21T23:01:33Z", GoVersion:"go1.16.4", Compiler:"gc", Platform:"linux/amd64"}

  • Operating System and version (e.g. Linux, Windows, MacOS):
uname -a
Linux kursa 5.4.0-81-generic #91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
  • What arkade version is this?
arkade version
            _             _      
  __ _ _ __| | ____ _  __| | ___ 
 / _` | '__| |/ / _` |/ _` |/ _ \
| (_| | |  |   < (_| | (_| |  __/
 \__,_|_|  |_|\_\__,_|\__,_|\___|

Get Kubernetes apps the easy way

Version: 0.8.2
Git Commit: 8b3fbc0994129f6c14daef467593ae02799409c0

@alexellis
Copy link
Owner

Hi @YuviGold

Thanks for taking time to suggest an enhancement.

I think we would be willing to take a look at a PR that returned a different exit code and message for a mistyped or non-existing CLI for download.

Then we can discuss the lazy matching and fuzzy matching separately after.

Alex

@YuviGold
Copy link
Contributor Author

YuviGold commented Oct 7, 2021

@rgee0
Copy link
Contributor

rgee0 commented May 14, 2024

/close: fixed in #529

➜  arkade git:(master) arkade version
            _             _      
  __ _ _ __| | ____ _  __| | ___ 
 / _` | '__| |/ / _` |/ _` |/ _ \
| (_| | |  |   < (_| | (_| |  __/
 \__,_|_|  |_|\_\__,_|\__,_|\___|

Open Source Marketplace For Developer Tools

Version: 0.11.12
Git Commit: d93098490dd3ba78c556c89a502bdf139c29a458

➜  arkade git:(master) arkade install bla 
Error: no such app: bla, run "arkade install --help" for a list of apps

➜  arkade git:(master) echo $?            
1

@derek derek bot closed this as completed May 14, 2024
@alexellis
Copy link
Owner

/lock: resolved

@derek derek bot locked and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants