spm

simple password manager
git clone anongit@rnpnr.xyz:spm.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 9b0d87b94b5f2e00d410bbf5c126aa3ed6ebec06
Parent: 5e65a5493152182552be44b4afab3e9f9ec889fa
Author: Klemens Nanni
Date:   Thu, 16 Jun 2016 00:25:41 +0200

Merge common check, remove unneeded quotes

Diffstat:
Mspm.sh | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/spm.sh b/spm.sh @@ -31,8 +31,6 @@ die() { } _find() { - [ -z "${1}" ] && die 'Name must not be empty' - ENTRY=$(find "${STORE_DIR}" \( -type f -o -type l \) \ -iwholename "*${1}*".gpg \ | head -n2) @@ -58,7 +56,6 @@ readpw() { ## Commands add() { - [ -z "${1}" ] && die 'Name must not be empty' [ -e "${STORE_DIR}"/"${1}".gpg ] && die 'Entry already exists' readpw "Password for '${1}': " password @@ -76,7 +73,7 @@ list() { tree ${grps_only:+-d} --noreport -l --dirsfirst --sort=name -C \ -- "${STORE_DIR}/${1}" \ - | sed "s/.gpg//g" \ + | sed s/.gpg//g \ | less -E -i -K -R -X } @@ -99,6 +96,7 @@ show() { case "${1}" in add|del|show) + [ -z "${2}" ] && die 'Name must not be empty' ${1} "${2}" ;; list)