[PATCH 1/6] fish-completion: avoid printing errors with an empty password store
Johannes Altmanninger
aclopte at gmail.com
Thu Jun 25 23:41:06 CEST 2020
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(-)
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
--
2.27.0
More information about the Password-Store
mailing list