updated via script
parent
a8c55c6f71
commit
64a87d6b5f
12
rodo.rkt
12
rodo.rkt
|
@ -5,19 +5,23 @@
|
||||||
(displayln (hash-ref hash-list key)))
|
(displayln (hash-ref hash-list key)))
|
||||||
|
|
||||||
(define message (hash
|
(define message (hash
|
||||||
'help-messages "For usage type `rodo -h` or `rodo --help`"
|
'incorrect-usage-msg "For usage type `rodo -h` or `rodo --help`"
|
||||||
'file-not-found "Rodo has not been setup in your home directory\nWould you like to set it up now? [y/n]"
|
'file-not-found "rodo has not been setup in your home directory\nWould you like to set it up now? [y/n]"
|
||||||
'file-exists ".rodo file exists"
|
'file-exists ".rodo file exists"
|
||||||
'item-added "Item added"
|
'item-added "Item added"
|
||||||
'item-removed "item removed"
|
'item-removed "Item removed"
|
||||||
'initializing "Initializing rodo in your home directory"))
|
'initializing "Initializing rodo in your home directory"))
|
||||||
|
|
||||||
|
(define y-n (hash
|
||||||
|
'yes '("yes" "Yes" "y" "Y")
|
||||||
|
'no '("no" "No" "n" "N")))
|
||||||
|
|
||||||
; just figuring out stuff here
|
; just figuring out stuff here
|
||||||
(define (prompt-user prompt-message)
|
(define (prompt-user prompt-message)
|
||||||
(display-hash message prompt-message)
|
(display-hash message prompt-message)
|
||||||
(let ([user-input (read-line)])
|
(let ([user-input (read-line)])
|
||||||
(cond
|
(cond
|
||||||
[(member user-input '("yes" "Yes" "y" "Y"))
|
[(member user-input (hash-ref y-n 'yes))
|
||||||
(displayln "You chose yes")]
|
(displayln "You chose yes")]
|
||||||
[else
|
[else
|
||||||
(displayln "you chose something else")])))
|
(displayln "you chose something else")])))
|
||||||
|
|
Loading…
Reference in New Issue