<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>Often. I forget the username or email that I used when I subscribed to<br>a service. I store it in the password-store using multiline format.  I<br>use `pass show` to find this information. However, this makes the<br>password vulnerable to shoulder surfing. I'd like an option where I<br>only display the username/email/other metadata.<br><br>---<br> src/password-store.sh | 16 +++++++++++-----<br> 1 file changed, 11 insertions(+), 5 deletions(-)<br></div><div><br>diff --git a/src/password-store.sh b/src/password-store.sh<br>index d535a74..dafbdf7 100755<br>--- a/src/password-store.sh<br>+++ b/src/password-store.sh<br>@@ -223,9 +223,10 @@ cmd_usage() {<br>             List passwords.<br>         $PROGRAM find pass-names...<br>             List passwords that match pass-names.<br>-        $PROGRAM [show] [--clip,-c] pass-name<br>-            Show existing password and optionally put it on the clipboard.<br>+        $PROGRAM [show] [--clip,-c | --meta,-m] pass-name<br>+            Show existing password data and optionally put the password on the clipboard.<br>             If put on the clipboard, it will be cleared in $CLIP_TIME seconds.<br>+            If meta, only display the password metadata (everything but the first line).<br>         $PROGRAM grep search-string<br>             Search for password files containing search-string when decrypted.<br>         $PROGRAM insert [--echo,-e | --multiline,-m] [--force,-f] pass-name<br>@@ -294,12 +295,13 @@ cmd_init() {<br> }<br> <br> cmd_show() {<br>-    local opts clip=0<br>-    opts="$($GETOPT -o c -l clip -n "$PROGRAM" -- "$@")"<br>+    local opts clip=0 meta=0<br>+    opts="$($GETOPT -o cm -l clip,meta -n "$PROGRAM" -- "$@")"<br>     local err=$?<br>     eval set -- "$opts"<br>     while true; do case $1 in<br>         -c|--clip) clip=1; shift ;;<br>+                -m|--meta) meta=1; shift ;;<br>         --) shift; break ;;<br>     esac done<br> <br>@@ -310,7 +312,11 @@ cmd_show() {<br>     check_sneaky_paths "$path"<br>     if [[ -f $passfile ]]; then<br>         if [[ $clip -eq 0 ]]; then<br>-            $GPG -d "${GPG_OPTS[@]}" "$passfile" || exit $?<br>+            if [[ $meta -eq 0 ]]; then<br>+                $GPG -d "${GPG_OPTS[@]}" "$passfile" || exit $?<br>+            else<br>+                $GPG -d "${GPG_OPTS[@]}" "$passfile" | tail --lines=+2 || exit$?<br>+            fi<br>         else<br>             local pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | head -n 1)"<br>             [[ -n $pass ]] || exit 1<span class="HOEnZb"><font color="#888888"><br>-- <br>1.9.1<br><br></font></span></div></div>
</div></div>