m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/completion/pass.fish-completion
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2020-06-25 23:41:08 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2020-06-25 15:43:00 -0600
commit9ec2990e96031e617237ac4881288974a69b7522 (patch)
treee5a201a69515e4e794d577932003acb0d4401bcc /src/completion/pass.fish-completion
parent3be8496c7488bce380e8072a98a353f9b90875a1 (diff)
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 (limited to 'src/completion/pass.fish-completion')
-rw-r--r--src/completion/pass.fish-completion6
1 files changed, 1 insertions, 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