aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/password-store.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/password-store.sh')
-rwxr-xr-xsrc/password-store.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index eac5404..19b3124 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -395,10 +395,10 @@ cmd_find() {
}
cmd_grep() {
- [[ $# -ne 1 ]] && die "Usage: $PROGRAM $COMMAND search-string"
- local search="$1" passfile grepresults
+ [[ $# -lt 1 ]] && die "Usage: $PROGRAM $COMMAND search-string"
+ local passfile grepresults
while read -r -d "" passfile; do
- grepresults="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | grep --color=always "$search")"
+ grepresults="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | grep --color=always "$@")"
[[ $? -ne 0 ]] && continue
passfile="${passfile%.gpg}"
passfile="${passfile#$PREFIX/}"