commit e936e9cfec43b87e7d1efabb93439bda214a0d99
parent b70e5ff4498e174c82fa89226fb535e171aec37b
Author: Klemens Nanni <kl3@posteo.org>
Date: Tue, 19 Jul 2016 16:47:13 +0200
Strip $STORE_DIR from 'search' output, add example
Diffstat:
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/spm.1 b/spm.1
@@ -1,4 +1,4 @@
-.TH spm 1 2016-06-30 spm-1.4.5 "Commands Manual"
+.TH spm 1 2016-07-16 spm-1.4.5 "Commands Manual"
.SH NAME
spm \- simple password manager
.SH SYNOPSIS
@@ -103,5 +103,11 @@ Show all entries matching the pattern 'sys':
.Vb 1
\& $ spm search sys
.Ve
+.PP
+Get the first password among all matching the given pattern:
+.PP
+.Vb 1
+\& $ spm get $(spm search sys | head -n1)
+.Ve
.SH SEE ALSO
\&\fIgit\fR\|(1), \fIgpg2\fR\|(1), \fIln\fR\|(1), \fIpwgen\fR\|(1), \fItpm\fR\|(1), \fIxclip\fR\|(1)
diff --git a/spm.sh b/spm.sh
@@ -53,7 +53,7 @@ _search() {
}
view() {
- sed s/.gpg//g | less -E -i -K -R -X
+ sed -e s/.gpg//g | less -E -i -K -R -X
}
## Commands
@@ -87,7 +87,9 @@ del() {
}
search() {
- _search "${1}" | view
+ _search "${1}" \
+ | sed -e s"^${STORE_DIR}/" \
+ | view
}
show() {