Skip to content

Instantly share code, notes, and snippets.

@danielhauck
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielhauck/06c7efaffad066d8ccbe to your computer and use it in GitHub Desktop.
Save danielhauck/06c7efaffad066d8ccbe to your computer and use it in GitHub Desktop.
ct completion for zsh
#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
@danielhauck
Copy link
Author

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

@robert-weissgraeber
Copy link

👎 missing unit tests.

@danielhauck
Copy link
Author

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