Add export completion and disallow alias

This commit is contained in:
Shohei YOSHIDA 2026-02-17 14:17:14 +09:00
parent f6c262ad83
commit 532813bd3b
No known key found for this signature in database
GPG Key ID: C9A1BB11BB940CF2
1 changed files with 8 additions and 0 deletions

View File

@ -43,9 +43,11 @@ _direnv_commands() {
'grant:Grants direnv permission to load the given .envrc or .env file' 'grant:Grants direnv permission to load the given .envrc or .env file'
'block:Revokes the authorization of a given .envrc or .env file' 'block:Revokes the authorization of a given .envrc or .env file'
'deny:Revokes the authorization of a given .envrc or .env file' 'deny:Revokes the authorization of a given .envrc or .env file'
'disallow:Revokes the authorization of a given .envrc or .env file'
'revoke:Revokes the authorization of a given .envrc or .env file' 'revoke:Revokes the authorization of a given .envrc or .env file'
'edit:Opens PATH_TO_RC or the current .envrc or .env into an $EDITOR and allow the file to be loaded afterwards' 'edit:Opens PATH_TO_RC or the current .envrc or .env into an $EDITOR and allow the file to be loaded afterwards'
'exec:Executes a command after loading the first .envrc or .env found in DIR' 'exec:Executes a command after loading the first .envrc or .env found in DIR'
'export:Loads an .envrc or .env and prints the diff in terms of exports'
"fetchurl:Fetches a given URL into direnv's CAS" "fetchurl:Fetches a given URL into direnv's CAS"
'help:shows this help' 'help:shows this help'
'hook:Used to setup the shell hook' 'hook:Used to setup the shell hook'
@ -82,6 +84,12 @@ _direnv() {
'2:command:_command_names' \ '2:command:_command_names' \
&& ret=0 && ret=0
;; ;;
(export)
local -a supported_shells=(bash elvish gha gzenv murex tcsh vim zsh fish json pwsh systemd)
_arguments \
'1:shell:($supported_shells)' \
&& ret=0
;;
(hook) (hook)
_arguments \ _arguments \
'1:shell:(bash zsh fish tcsh elvish)' \ '1:shell:(bash zsh fish tcsh elvish)' \