-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgolemail.rkt
39 lines (34 loc) · 957 Bytes
/
golemail.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#lang racket
(require racket/cmdline
racket/system
"client.rkt"
"core/configuration.rkt"
"core/headers-analysis.rkt"
"core/imap-access.rkt"
"core/parsing.rkt"
"core/reminders.rkt"
"core/schedule.rkt"
"core/structures.rkt")
(define version "0.0.2")
(define show-version (make-parameter #f))
(define (get-password)
(dynamic-wind
(λ()
(printf (~a "Insert password for " (username) ": ")) (system* "/bin/stty" "-echo" "echonl"))
read-line
(λ() (system* "/bin/stty" "echo"))))
(command-line
#:program "golemail"
#:once-each
[("--version") "Show version"
(show-version #t)])
(cond [(show-version)
(displayln (~a "golemail version " version))]
[else
(password (get-password))
(let loop()
(thread-wait (thread main))
(collect-garbage)
(sleep (polling-interval))
(loop))]
)