spm

Personal fork of spm (simple password manager)
git clone git@getsh.org:spm.git
Log | Files | Refs | README | LICENSE

commit ffd5a3e7a378040a7d6e3c95193bf4cbf3bab19b
parent ecb67d9653966e0c013ce22e3b19a1946fa7f451
Author: Sören Tempel <soeren+git@soeren-tempel.net>
Date:   Mon, 12 Oct 2015 21:35:42 +0200

Don't use shift at all

Both available commands (insert and show) only accept a single argument
so handling the command line arguments this way is easier and more
foolproof. This fixes issue #5.

Diffstat:
Mtpm | 9+++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/tpm b/tpm @@ -106,12 +106,9 @@ if [ $# -gt 2 ]; then abort "tpm doesn't accept more than two arguments" fi -cmd="${1}" -shift - -case "${cmd}" in - "show") show "${@}" ;; - "insert") insert "${@}" ;; +case "${1}" in + "show") show "${2}" ;; + "insert") insert "${2}" ;; *) abort "USAGE: tpm COMMAND ENTRY" ;; esac