diff --git a/README.md b/README.md index a92e1137..fa9ba160 100644 --- a/README.md +++ b/README.md @@ -53,25 +53,39 @@ If you have Go installed, you can build and install the `hcloud` program with: See `hcloud help` for a list of commands. ## Shell Completion +To load completions: -To enable shell completion, run one of the following commands (or better, -add it to your `.bashrc` or `.zshrc`): +**Bash:** +``` +$ source <(hcloud completion bash) +# To load completions for each session, execute once: +Linux: + $ hcloud completion bash > /etc/bash_completion.d/hcloud +MacOS: + $ hcloud completion bash > /usr/local/etc/bash_completion.d/hcloud ``` -$ source <(hcloud completion bash) # bash -$ source <(hcloud completion zsh)   # zsh + +**Zsh:** ``` +# If shell completion is not already enabled in your environment you will need +# to enable it. You can execute the following once: + +$ echo "autoload -U compinit; compinit" >> ~/.zshrc -If you are using antigen with zsh and completion doesn't work with the above try adding +# To load completions for each session, execute once: +$ hcloud completion zsh > "${fpath[1]}/_hcloud" +# You will need to start a new shell for this setup to take effect. ``` -function _hcloud_completion { - source <(hcloud completion zsh)   # zsh -} -compctl -K _hcloud_completion hcloud + +**Fish:** ``` -instead. +$ hcloud completion fish | source +# To load completions for each session, execute once: +$ hcloud completion fish > ~/.config/fish/completions/hcloud.fish +``` ## Output configuration