From 46d26994d0ff6b7fdcc2b043b0186703c0026b06 Mon Sep 17 00:00:00 2001
From: Johannes Altmanninger <aclopte@gmail.com>
Date: Thu, 25 Jun 2020 23:41:06 +0200
Subject: 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.
---
 src/completion/pass.fish-completion | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src')

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
-- 
cgit v1.2.3