Opening vCard file as free cli argument
Now you can run, ex., $ ./contact ~/whatever.vcf
This commit is contained in:
parent
ab78dba5a3
commit
670b9b86d6
15
contact.scm
15
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)
|
||||
|
|
Ŝarĝante…
Reference in New Issue