diff --git a/contact.scm b/contact.scm index 786c02c..22bbc3f 100644 --- a/contact.scm +++ b/contact.scm @@ -54,15 +54,18 @@ (thread-start! (lambda () (nrepl (string->number (alist-ref 'repl cli-args)))))))] + ;; Open the free-argument file. + (if (condition-case (not (null? (last (car cli-args)))) (var () #f)) + (open-vcard-file qt-win (last (car cli-args)))) ;; … and also provide a local REPL. - (repl) - ;; Wait for the QT program, even after stdin is closed off. - (thread-join! qt-thread)))) + (repl) + ;; Wait for the QT program, even after stdin is closed off. + (thread-join! qt-thread)))) ;; Print a “usage” help message, telling the user how to run the program. (define (cli-usage) - (print "usage: " (pathname-file (program-name)) " [-h] [--repl PORT]") + (print "usage: " (pathname-file (program-name)) " [-h] [--repl PORT] [VCF_FILE]") (print) (print (pathname-file (program-name)) " is a simple contacts program for managing") (print "vCard-format contacts.") @@ -176,7 +179,6 @@ ;; (ADR ("TYPE=home") ("" "" "1234 Abc.", "", "", "", ""))) (define (populate-with-vcard window vcard-alist) (map (lambda (property) - (print property) (let* [(formname (alist-ref (car property) property->formname-alist)) (lineEditName (conc formname "LineEdit")) (lineEditWidget (if formname (qt:find window lineEditName) #f))] @@ -185,7 +187,4 @@ vcard-alist)) - - - (init)