commit 9ec2990e96031e617237ac4881288974a69b7522
parent 3be8496c7488bce380e8072a98a353f9b90875a1
Author: Johannes Altmanninger <aclopte@gmail.com>
Date: Thu, 25 Jun 2020 23:41:08 +0200
fish-completion: support completions for wrapper commands
There is no point to checking the command name, fish already does that.
Additionally fish knows about commands that "wrap" pass; those commands
should inherit pass's completions.
This commit enables fish>=3.1.0 to provide proper completions for this function:
alias p="PASSWORD_STORE_DIR=$HOME/.my-passwords pass"
or, equivalently,
function p --wraps "PASSWORD_STORE_DIR=$HOME/.my-passwords pass"
PASSWORD_STORE_DIR=$HOME/.my-passwords pass $argv
end
Diffstat:
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/completion/pass.fish-completion b/src/completion/pass.fish-completion
@@ -14,11 +14,7 @@ function __fish_pass_get_prefix
end
function __fish_pass_needs_command
- set -l cmd (commandline -opc)
- if [ (count $cmd) -eq 1 -a $cmd[1] = $PROG ]
- return 0
- end
- return 1
+ [ (count (commandline -opc)) -eq 1 ]
end
function __fish_pass_uses_command