m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/completion
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2020-06-25 23:41:06 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2020-06-25 15:42:32 -0600
commit46d26994d0ff6b7fdcc2b043b0186703c0026b06 (patch)
treee64eef800c426ae69c50ba942b025e2e0fa9ba29 /src/completion
parent07b169ec32ad6961ed8625a0b932a663abcb01d2 (diff)
fish-completion: avoid printing errors with an empty password store
Reproduce by typing "pass <TAB>" in a shell launched like: HOME=`mktemp -d` fish Fish prints an error on failing globs - except when used in one of the commands "set", "for" or "count". Also quotes are unnecessary here.
Diffstat (limited to 'src/completion')
-rw-r--r--src/completion/pass.fish-completion3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/completion/pass.fish-completion b/src/completion/pass.fish-completion
index 8637874..abc7b32 100644
--- a/src/completion/pass.fish-completion
+++ b/src/completion/pass.fish-completion
@@ -39,7 +39,8 @@ function __fish_pass_print
set -l ext $argv[1]
set -l strip $argv[2]
set -l prefix (__fish_pass_get_prefix)
- printf '%s\n' "$prefix"/**"$ext" | sed "s#$prefix/\(.*\)$strip#\1#"
+ set -l matches $prefix/**$ext
+ printf '%s\n' $matches | sed "s#$prefix/\(.*\)$strip#\1#"
end
function __fish_pass_print_entry_dirs