From 9ec2990e96031e617237ac4881288974a69b7522 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Thu, 25 Jun 2020 23:41:08 +0200 Subject: 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 --- src/completion/pass.fish-completion | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/completion/pass.fish-completion b/src/completion/pass.fish-completion index 1edc3fa..b7c3c8c 100644 --- 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 -- cgit v1.2.3