Skip to content

Instantly share code, notes, and snippets.

@jimjh
Last active November 2, 2015 21:58
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 jimjh/ae987c92e3bd8d0d0fff to your computer and use it in GitHub Desktop.
Save jimjh/ae987c92e3bd8d0d0fff to your computer and use it in GitHub Desktop.
zsh autocompletion for vault's subcommands
#compdef vault
# See https://vaultproject.io/
# Drop this file in ~/.oh-my-zsh/completions/_vault
subcommands=$(vault --help 2|& grep -E '^\s{4}' | awk '{printf $1; $1=""; print "\\:\x27"$0"\x27"}')
_arguments "1:subcommand:((${subcommands}))"
_message 'vault [-version] [-help] <command> [args]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment