Better error message for list op, if db is empty - pee - Pee a password manager… | |
git clone git://vernunftzentrum.de/pee.git | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit a5c8e7929fc90d2ddf8c560a2f3154b473af269c | |
parent 355c19b08a7b416c431604bed973805c0de1c792 | |
Author: Christian Kellermann <[email protected]> | |
Date: Wed, 16 Nov 2016 14:55:41 +0100 | |
Better error message for list op, if db is empty | |
Diffstat: | |
pee.scm | 20 ++++++++++++-------- | |
1 file changed, 12 insertions(+), 8 deletions(-) | |
--- | |
diff --git a/pee.scm b/pee.scm | |
@@ -345,14 +345,18 @@ | |
(irregex-match regex k)) | |
(db-keys db)) | |
string<=))) | |
- (when (null? accounts) | |
- (print "Error: No entry for " account " found.") | |
- (exit 1)) | |
- (print-entries (map | |
- (lambda (account-name) | |
- (alist-ref account-name db equal?)) | |
- accounts) | |
- prefixes: accounts))) | |
+ (cond ((null? (db-keys db)) | |
+ (print "Error: No keys in password store") | |
+ (exit 1)) | |
+ ((null? accounts) | |
+ (print "Error: No entry for " account " found.") | |
+ (exit 1)) | |
+ (else | |
+ (print-entries (map | |
+ (lambda (account-name) | |
+ (alist-ref account-name db equal?)) | |
+ accounts) | |
+ prefixes: accounts))))) | |
(define (do-password db e) | |
(cond ((alist-ref e db equal?) => |