[pass] 'show' and 'find' only actual password entries

Jason A. Donenfeld Jason at zx2c4.com
Mon May 11 13:55:09 CEST 2015


Comments in-line below.


> From 14ccc3a1945b9f2754309d64fa3e342232c713a2 Mon Sep 17 00:00:00 2001
> From: George Angelopoulos <george at usermod.net>
> Date: Thu, 12 Feb 2015 19:46:30 +0100
> Subject: [PATCH] show and find only actual password entries (*.gpg)
> Password stores might contain things that are not password entries -
> for example, a README.md file, if uploaded to a service like GitLab
> and used by multiple people. Such a file has no reason to be shown
> by "pass show" or "pass find".
> ---
>  src/password-store.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> diff --git a/src/password-store.sh b/src/password-store.sh
> index 47f7ffa..6218c6c 100755
> --- a/src/password-store.sh
> +++ b/src/password-store.sh
> @@ -322,7 +322,7 @@ cmd_show() {
>   else
>   echo "${path%\/}"
>   fi
> - tree -C -l --noreport "$PREFIX/$path" | tail -n +2 | sed
> 's/\.gpg\(\x1B\[[0-9]\+m\)\{0,1\}\( ->\|$\)/\1\2/g' # remove .gpg at end of
> line, but keep colors
> + tree -C -l --noreport "$PREFIX/$path" -P '*.gpg' | tail -n +2 | sed
> 's/\.gpg\(\x1B\[[0-9]\+m\)\{0,1\}\( ->\|$\)/\1\2/g' # remove .gpg at end of
> line, but keep colors
>   elif [[ -z $path ]]; then
>   die "Error: password store is empty. Try \"pass init\"."
>   else
> @@ -334,7 +334,7 @@ cmd_find() {
>   [[ -z "$@" ]] && die "Usage: $PROGRAM $COMMAND pass-names..."
>   IFS="," eval 'echo "Search Terms: $*"'
>   local terms="*$(printf '%s*|*' "$@")"
> - tree -C -l --noreport -P "${terms%|*}" --prune --matchdirs
> --ignore-case "$PREFIX" | tail -n +2 | sed
> 's/\.gpg\(\x1B\[[0-9]\+m\)\{0,1\}\( ->\|$\)/\1\2/g'
> + tree -C -l --noreport -P "${terms%|*}.gpg" --prune --matchdirs
> --ignore-case "$PREFIX" -P '*.gpg' | tail -n +2 | sed
> 's/\.gpg\(\x1B\[[0-9]\+m\)\{0,1\}\( ->\|$\)/\1\2/g'
>

This line already has a -P with .gpg. Seems like adding it at the end is
redundant. Can you resubmit this with just the first fix?



>  }
>
>  cmd_grep() {
> --
> 2.3.0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20150511/5d1520e7/attachment.html>


More information about the Password-Store mailing list