-
-
Save roalcantara/54b967254d86de211f48e21017eccb4f to your computer and use it in GitHub Desktop.
direnv sub-commands completion for zsh. inspired https://gist.github.com/yonchu/5005758
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
#!/bin/zsh | |
#compdef direnv | |
# setopt -eu | |
function _direnv { | |
# https://gist.github.com/h14i/9183369 | |
local direnv | |
local -a comp_list | |
direnv="\ | |
allow[Grants direnv to load the given .envrc] | |
deny[Revokes the authorization of a given .envrc] | |
edit[Opens PATH_TO_RC or the current .envrc into an $EDITOR and allow the file to be loaded afterwards.] | |
exec[Executes a DIR COMMAND after loading the first .envrc found in DIR] | |
fetchurl[Fetches a given <url> into direnv's CAS] | |
help[shows this help] | |
hook[Used to setup the SHELL hook] | |
prune[removes old allowed files] | |
reload[triggers an env reload] | |
status[prints some debug status information] | |
stdlib[Displays the stdlib available in the .envrc execution context] | |
version[prints the version (2.28.0) or checks that direnv is older than VERSION_AT_LEAST.]" | |
comp_list=( ${(f)direnv} ) | |
_values 'direnv subcmds' "$comp_list[@]" | |
} | |
_direnv "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment