Skip to content

Instantly share code, notes, and snippets.

@trobrock
Created July 16, 2013 23:45
Show Gist options
  • Save trobrock/6016291 to your computer and use it in GitHub Desktop.
Save trobrock/6016291 to your computer and use it in GitHub Desktop.
#compdef knife_ssh
#autoload
_knife_ssh() {
if hash knife 2>/dev/null; then
if [[ ! -f ~/.knife_comp~ ]]; then
echo "\nGenerating ~/.knife_comp~..." >/dev/stderr
knife node list > ~/.knife_comp~
fi
compadd `cat ~/.knife_comp~`
else
echo "Could not find knife" > /dev/stderr;
fi
}
_knife_ssh "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment