2018-10-10 17:55:52 +00:00
|
|
|
#lang racket/base
|
|
|
|
|
2018-10-10 18:57:00 +00:00
|
|
|
(require (prefix-in config: "config.rkt"))
|
2018-10-10 17:55:52 +00:00
|
|
|
|
|
|
|
(provide (all-defined-out))
|
|
|
|
|
|
|
|
(define messages
|
|
|
|
(hash
|
2018-10-10 18:57:00 +00:00
|
|
|
'show-help
|
|
|
|
(string-append
|
|
|
|
config:initialize-command ":\n"
|
|
|
|
"initialize a file in "
|
|
|
|
config:program-path
|
|
|
|
config:program-directory
|
|
|
|
config:program-file
|
|
|
|
"\n"
|
|
|
|
"Example: "
|
|
|
|
"rodo init\n\n"
|
|
|
|
|
|
|
|
config:list-command ":\n"
|
|
|
|
"lists items on the list"
|
|
|
|
"\n"
|
|
|
|
"Example: "
|
|
|
|
"rodo ls\n\n"
|
|
|
|
|
|
|
|
config:add-command ":\n"
|
|
|
|
"adds an item to the list"
|
|
|
|
"\n"
|
|
|
|
"Example: "
|
|
|
|
"rodo add bread\n\n"
|
|
|
|
"Note: For multi-word items you will need to\n"
|
|
|
|
"surround your item in double quotes as so:\n"
|
|
|
|
"rodo add \"go to the bank\"\n\n"
|
|
|
|
|
|
|
|
config:remove-command ":\n"
|
|
|
|
"removes an item from the list\n"
|
|
|
|
"Example: "
|
|
|
|
"rodo rm 1\n\n"
|
|
|
|
"Note: You may have to run `rodo ls` to see which\n"
|
|
|
|
"number corresponds to which item to remove it.\n")
|
|
|
|
|
|
|
|
'empty-todo-list
|
|
|
|
"> There is nothing in your list \n"
|
|
|
|
|
|
|
|
'show-usage
|
|
|
|
(string-append
|
|
|
|
"> For usage type "
|
|
|
|
"`" config:program-name " -h`"
|
|
|
|
" or "
|
|
|
|
"`" config:program-name " --help`\n")
|
|
|
|
|
|
|
|
'creating-folder
|
|
|
|
(string-append
|
|
|
|
"> creating a "
|
|
|
|
config:program-directory
|
|
|
|
" folder in "
|
|
|
|
config:program-path " ...\n")
|
|
|
|
|
|
|
|
'creating-file
|
|
|
|
(string-append
|
|
|
|
"> creating a "
|
|
|
|
config:program-file
|
|
|
|
" file in "
|
|
|
|
config:program-path
|
|
|
|
config:program-directory " ...\n")
|
|
|
|
|
|
|
|
'creation-error
|
|
|
|
(string-append
|
|
|
|
"> Error: Could not create "
|
|
|
|
config:program-file
|
|
|
|
" in "
|
|
|
|
config:program-directory
|
|
|
|
config:program-path ".\n"
|
|
|
|
"> This may be due to directory permissions\n")
|
|
|
|
|
|
|
|
'file-already-exists
|
|
|
|
(string-append
|
|
|
|
"> Error: "
|
|
|
|
config:program-name
|
|
|
|
" already exists in "
|
|
|
|
config:program-path
|
|
|
|
config:program-directory
|
|
|
|
config:program-file "\n")
|
|
|
|
|
|
|
|
'successfully-created
|
|
|
|
(string-append
|
|
|
|
"> "
|
|
|
|
config:program-path
|
|
|
|
config:program-directory
|
|
|
|
config:program-file
|
|
|
|
" has been successfully created\n")
|
|
|
|
|
|
|
|
'file-not-found
|
|
|
|
(string-append
|
|
|
|
"> Error: Could not find "
|
|
|
|
config:program-path
|
|
|
|
config:program-directory
|
|
|
|
config:program-file "\n")
|
|
|
|
|
|
|
|
'init-y/n
|
|
|
|
(string-append
|
|
|
|
"> A "
|
|
|
|
config:program-file
|
|
|
|
" file will be created in "
|
|
|
|
config:program-path
|
|
|
|
config:program-directory "\n"
|
|
|
|
"> Are you sure you want to continue? [y/n]\n")
|
|
|
|
|
|
|
|
'try-init
|
|
|
|
(string-append
|
|
|
|
"> Try typing "
|
|
|
|
"`" config:program-name " init` "
|
|
|
|
"to set it up\n")
|
|
|
|
|
|
|
|
'terminating
|
|
|
|
(string-append
|
|
|
|
"> Exiting "
|
|
|
|
config:program-name
|
|
|
|
" ...\n")
|
|
|
|
|
|
|
|
'choose-y/n
|
|
|
|
"> Error: Please choose y or n\n"
|
|
|
|
|
|
|
|
'not-in-list
|
|
|
|
"> Error: Item does not exist\n"
|
|
|
|
|
|
|
|
'item-added-prefix
|
|
|
|
"> Added "
|
|
|
|
|
|
|
|
'item-added-suffix
|
|
|
|
" to list\n"
|
|
|
|
|
|
|
|
'item-removed-prefix
|
|
|
|
"> Removed "
|
|
|
|
|
|
|
|
'item-removed-suffix
|
|
|
|
" from list\n"))
|
2018-10-10 17:55:52 +00:00
|
|
|
|
|
|
|
(define y/n
|
|
|
|
(hash
|
2018-10-10 18:57:00 +00:00
|
|
|
'yes
|
|
|
|
'("yes" "Yes" "y" "Y")
|
2018-10-10 17:55:52 +00:00
|
|
|
|
2018-10-10 18:57:00 +00:00
|
|
|
'no
|
|
|
|
'("no" "No" "n" "N")))
|