diff --git a/README.md b/README.md index cdef8ed..35aa50b 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ See `Makefile` comments to see how language specific zip archives are created. - [x] C++ - [x] JavaScript -- [ ] Java -- [ ] Python -- [ ] Ruby +- [x] Java +- [x] Python +- [x] Ruby ### Run diff --git a/shared/README.md b/shared/README.md index 01ad227..15fe0bd 100644 --- a/shared/README.md +++ b/shared/README.md @@ -20,7 +20,7 @@ Here's how it should work when you're done: ## Specification -1. The app can be run in the console with `node todo.js`. +1. The app can be run in the console with `./todo.sh`. 2. The app should read from and write to a `todo.txt` text file. Each todo item occupies a single line in this file. Here is an example file that has 2 todo items. @@ -41,10 +41,10 @@ x 2020-06-12 the text contents of the todo item The date when the todo is marked as completed is recorded in the `yyyy-mm-dd` format (ISO 8601). For example, a date like `15th August, 2020` is represented as `2020-08-15`. -4. The application must open the files `todo.txt` and `done.txt` from where the app is run, and not where the app is located. For example, if we invoke the app like this: +4. The application must open the files `todo.txt` and `done.txt` from where the app is run, and not where the app is located. For example, if we invoke the app like this: - $ cd ~/plans - $ node ~/apps/todo.js ls + $ cd ~/plans + $ ~/apps/todo.sh ls The application should look for the text files in ~/plans, since that is the user’s current directory. @@ -55,14 +55,14 @@ The application should look for the text files in ~/plans, since that is the use Executing the command without any arguments, or with a single argument `help` prints the CLI usage. ``` -$ node todo.js help +$ ./todo.sh help Usage :- -$ node todo.js add "todo item" # Add a new todo -$ node todo.js ls # Show remaining todos -$ node todo.js del NUMBER # Delete a todo -$ node todo.js done NUMBER # Complete a todo -$ node todo.js help # Show usage -$ node todo.js report # Statistics +$ ./todo.sh add "todo item" # Add a new todo +$ ./todo.sh ls # Show remaining todos +$ ./todo.sh del NUMBER # Delete a todo +$ ./todo.sh done NUMBER # Complete a todo +$ ./todo.sh help # Show usage +$ ./todo.sh report # Statistics ``` ### 2. List all pending todos @@ -70,7 +70,7 @@ $ node todo.js report # Statistics Use the `ls` command to see all the todos that are not yet complete. The most recently added todo should be displayed first. ``` -$ node todo.js ls +$ ./todo.sh ls [2] change light bulb [1] water the plants ``` @@ -80,7 +80,7 @@ $ node todo.js ls Use the `add` command. The text of the todo item should be enclosed within double quotes (otherwise only the first word is considered as the todo text, and the remaining words are treated as different arguments). ``` -$ node todo.js add "the thing i need to do" +$ ./todo.sh add "the thing i need to do" Added todo: "the thing i need to do" ``` @@ -89,14 +89,14 @@ Added todo: "the thing i need to do" Use the `del` command to remove a todo item by its number. ``` -$ node todo.js del 3 +$ ./todo.sh del 3 Deleted todo #3 ``` Attempting to delete a non-existent todo item should display an error message. ``` -$ node todo.js del 5 +$ ./todo.sh del 5 Error: todo #5 does not exist. Nothing deleted. ``` @@ -105,14 +105,14 @@ Error: todo #5 does not exist. Nothing deleted. Use the `done` command to mark a todo item as completed by its number. ``` -$ node todo.js done 1 +$ ./todo.sh done 1 Marked todo #1 as done. ``` Attempting to mark a non-existed todo item as completed will display an error message. ``` -$ node todo.js done 5 +$ ./todo.sh done 5 Error: todo #5 does not exist. ``` @@ -121,6 +121,6 @@ Error: todo #5 does not exist. Use the `report` command to see the latest tally of pending and completed todos. ``` -$ node todo.js report +$ ./todo.sh report dd/mm/yyyy Pending : 1 Completed : 4 ```