kontaktdb

Store, retrieve, and edit basic contact information in plain text.
git clone https://git.sr.ht/~jbauer/kontaktdb
Log | Files | Refs | README | LICENSE

commit 3d56cd1075a015b1cd4873cb9ed38a8cb4136223
parent 80df59499c4509d94ec44a95eeb7b66bc5023d12
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Fri, 12 Jun 2020 17:59:08 -0400

Add friendly, non-flag action syntax

Diffstat:
Mkontakt | 18++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/kontakt b/kontakt @@ -84,6 +84,8 @@ Available actions: -d|--delete <query> delete a contact -l|--list list all contacts in the database +Friendly names of actions can also be used. E.g. 'kontakt add' is valid. + Arguments: <query> the string to search the database for <name> the contact's name @@ -111,44 +113,44 @@ query="" while test $# -gt 0; do case "$1" in - -h|--help) + -h|--help|help) echo "$helptext" exit 0 ;; - -v|--version) + -v|--version|version) echo "$VERSION" exit 0 ;; - -a|--add) + -a|--add|add) name=$2 email=$3 query=$email add_contact exit 0 ;; - -c|--change) + -c|--change|change) query=$2 name=$3 email=$4 change_contact exit 0 ;; - -r|--retrieve) + -r|--retrieve|retrieve) query=$2 retrieve_contact exit 0 ;; - -d|--delete) + -d|--delete|delete) query=$2 delete_contact exit 0 ;; - -l|--list) + -l|--list|list) cat "$addressFile" exit 0 ;; *) - echo "Unrecognized option; see '-h or --help'." + echo "Unrecognized option; see 'kontakt help'." exit 1 ;; esac