Sdkman-cli: Add tab completion/auto complete

Created on 5 Dec 2012  路  7Comments  路  Source: sdkman/sdkman-cli

It would be great if I could tab to complete my command.

Especially handy when it gets to providing a version.
You'd be able to see available versions as you're typing (saves you from doing a gvm list <candidate>).

enhancement

Most helpful comment

All 7 comments

Hi,

I have included tab completion to zsh through oh-my-zsh.

If you happen to use zsh and oh-my-zsh then you can get auto-completion by following the steps below.

  1. create a new gvm folder in the plugins folder
  2. create a file named "_gvm"
  3. Add the content of the commit below in the _gvm file.

https://github.com/yerinle/oh-my-zsh/commit/74526e64dc57ffdfa264319c59ffd502de6fc014

  1. Start a new shell and you will now have tab completion.

I have sent a pull request to the maintainer and I hope it gets included soon, which will make installation
a breeze.

Excellent! Thank you!

You are welcome.

What are you thoughts on including description of each commands with the tool?
For example, executing "gvm help --info" and then you get the list below

broadcast -- display the last broadcast message
current -- dispaly current candidate version
default -- set the default candidate version for every shell
help -- show the gvm help message
install -- install a candidate version
list -- list available candidate versions
selfupdate -- update the gvm
uninstall -- uninstall a candidate version
use -- use a candidate version in current shell
version -- display the current version of gvm

This is what I currently present in zsh but it will be good for this to be in
a central place and not be repeated/duplicated for each shell (e.g bash).
That way all users will have a similar experience and we keep it DRY.

Thanks.

Issue #45 is about improving the help command to be more descriptive. Moving this discussion to that issue.

For Oh-My-Zsh, please check out https://github.com/robbyrussell/oh-my-zsh/pull/6483

Was this page helpful?
0 / 5 - 0 ratings