Write a command line todo-list app.
Running the program should load you into a REPL (read-eval-print loop).
A user should be able to enter a command by typing: COMMAND:argument i.e. a single word command followed by a colon, with everything to the right of the colon being the argument, then hitting the enter key. If a command takes no argument then the user should be allowed to omit the colon.
Implement the following 5 commands:
-
"quit" (takes no arguments) - exits the application
-
"help" (takes no arguments) - prints these command descriptions
-
"add" (takes any non-empty string as an argument) - adds its argument to the end of the todo-list
-
"remove" (takes a non-negative integer less than the size of the todo-list as an argument) - removes the element at the index specified by the argument
-
"list" (takes no arguments) - prints the todo-list to the screen in the format "element_position - message"
If the user enters an invalid command or an invalid argument, print a helpful error message and let them try again.
Extra credit:
- "save" (takes a filepath as an argument) - saves the todo-list to the specified file
- "load" (takes a filepath as an argument) - replaces the current todo-list with one contained in the specified file
Extra extra credit:
If the user has made unsaved changes and tries to quit or load, they should first be presented with an interactive dialog that will help them save to a file if they'd like to.