Skip to content

Instantly share code, notes, and snippets.

@h14i
Created February 24, 2014 07:26
Show Gist options
  • Save h14i/9183369 to your computer and use it in GitHub Desktop.
Save h14i/9183369 to your computer and use it in GitHub Desktop.
direnv sub-commands completion for zsh. inspired https://gist.github.com/yonchu/5005758
#compdef direnv
# setopt -eu
function _direnv {
local direnv
local -a comp_list
direnv="\
allow[Grants direnv to load the given .envrc]
deny[Revokes the auhorization of a given .envrc]
edit[Edits .envrc]
help[shows this help]
hook[Used to setup the shell hook]
reload[triggers an env reload]
status[prints some debug status informations]
stdlib[Displays the stdlib available in the .envrc execution context]"
comp_list=( ${(f)direnv} )
_values 'direnv subcmds' "$comp_list[@]"
}
_direnv "$@"
@h14i
Copy link
Author

h14i commented Feb 24, 2014

恐らくyonchuさんの_httpstatusを参考にしたと思われる。
forkしたほうが良かったかな…。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment