rodo/rodo.rkt

31 lines
1.0 KiB
Racket
Raw Normal View History

2018-03-12 14:02:54 +00:00
#! /usr/bin/env racket
#lang racket/base
2018-03-13 02:19:16 +00:00
(define (display-hash hash-list key)
(displayln (hash-ref hash-list key)))
2018-03-12 14:02:54 +00:00
(define message (hash
2018-03-13 02:19:16 +00:00
'help-messages "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]"
2018-03-12 14:02:54 +00:00
'file-exists ".rodo file exists"
'item-added "Item added"
'item-removed "item removed"
'initializing "Initializing rodo in your home directory"))
2018-03-13 02:19:16 +00:00
; just figuring out stuff here
(define (prompt-user prompt-message)
(display-hash message prompt-message)
(let ([user-input (read-line)])
(cond
[(member user-input '("yes" "Yes" "y" "Y"))
(displayln "You chose yes")]
[else
(displayln "you chose something else")])))
2018-03-12 14:02:54 +00:00
(define (todo-list-exist?)
(if (file-exists? (expand-user-path "~/.rodo"))
2018-03-13 02:19:16 +00:00
(display-hash message 'file-exists)
(prompt-user 'file-not-found)))
2018-03-12 14:02:54 +00:00
(todo-list-exist?)