spm

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

Commit: 17cc56061e392f7a3760fd791e4c8fe0bc162c31
Parent: 63ad505b4f2e883cd78c27bb57948370809929ad
Author: Klemens Nanni
Date:   Mon, 15 Aug 2016 22:10:18 +0200

Fix regression in 'list' command when used with '-g'

82e26fd fixed the parsing with regards to proper handling of too many
arguments but introduced a regression where 'spm list -g' would through
an error instead of listing groups only.

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

diff --git a/spm.sh b/spm.sh @@ -115,10 +115,11 @@ case "${1}" in ${1} "${2}" ;; list) - [ "${2}" = -g ] \ - && groups_only=1 && shift 1 \ - || [ ${#} -eq 3 ] \ - && usage 'Wrong number of arguments' + if [ "${2}" = -g ] && [ ${#} -le 3 ]; then + groups_only=1 && shift 1 + elif [ ${#} -gt 3 ]; then + usage 'Wrong number of arguments' + fi list "${2}" ;; help)