Last active
August 29, 2015 14:24
-
-
Save danielhauck/06c7efaffad066d8ccbe to your computer and use it in GitHub Desktop.
ct completion for zsh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef ct | |
_ct() { | |
local -a commands | |
IFS=$'\n' | |
commands=(${(f)"$(ct list --raw | sed 's/:/\\:/g' | awk -F" " '{print $1}')"}) | |
if (( CURRENT == 2 )); then | |
_describe -t commands 'commands' commands | |
fi | |
return 0 | |
} | |
_ct |
👎 missing unit tests.
It's not a moon, it's a gist ;)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create a folder your own zsh completions:
mkdir ~/.zsh_completions && cd $_
add this line to your .zshrc:
fpath=($HOME/.zsh-completions $fpath)
and reload your zsh:
exec zsh