Refactor account printing procedure - pee - Pee a password manager;Pee - because you have to...
 (HTM) git clone git://vernunftzentrum.de/pee.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 9ef725dc3d118b83b56b97690fc966f2df79add1
 (DIR) parent b1796046357c43e891ea45b50e9c4998d9a45060
 (HTM) Author: Christian Kellermann <ckeen@pestilenz.org>
       Date:   Wed, 20 Apr 2016 15:22:21 +0200
       
       Refactor account printing procedure
       
       Diffstat:
         pee.scm                             |      18 ++++++++++--------
       
       1 file changed, 10 insertions(+), 8 deletions(-)
       ---
 (DIR) diff --git a/pee.scm b/pee.scm
       @@ -194,6 +194,12 @@
                          db
                          equal?)))
        
       +(define (print-entry entry #!key show-password)
       +  (match-let (((user pass comment last-modified) entry))
       +             (printf "User: ~a\tPass: ~a\tComment: ~a\tLast changed: ~a~%"
       +                     user (if show-password pass "***") comment
       +                     (time->string (seconds->local-time last-modified) "%Y-%m-%d %H:%M:%S"))))
       +
        (define (check-access f)
          (and (file-exists? f)
               (file-read-access? f)
       @@ -299,10 +305,8 @@
        (define (do-delete db-name db p account)
          (cond ((alist-ref account db equal?) =>
                 (lambda (e)
       -           (match-let (((user _ comment last-modified) e))
       -                  (printf "Account: ~a\tUser: ~a\tComment: ~a\tLast changed: ~a~%"
       -                          account user comment
       -                          (time->string (seconds->local-time last-modified) "%Y-%m-%d %H:%M:%S")))
       +           (printf "Account: ~a" account)
       +           (print-entry e)
                   (cond ((ask-yes-or-no "Really delete account?")
                          (encrypt-file db-name  (alist-delete account db equal?) p)
                          (print "Entry '" account "' deleted."))
       @@ -324,10 +328,8 @@
                  (exit 1))
            (for-each
             (lambda (account-name)
       -       (match-let (((user _ comment last-modified) (alist-ref account-name db equal?)))
       -                  (printf "Account: ~a\tUser: ~a\tComment: ~a\tLast changed: ~a~%"
       -                          account-name user comment
       -                          (time->string (seconds->local-time last-modified) "%Y-%m-%d %H:%M:%S"))))
       +       (printf "Account: ~a\t" account-name)
       +       (print-entry (alist-ref account-name db equal?)))
             accounts)))
        
        (define (do-password db e)