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