Exercises
You can try the following exercises to expand your skills:
-
Implement the flag -del to delete an item from the list. Use the Delete method from the API to perform the action.
-
Add another flag to enable verbose output, showing information like date/time.
-
Add another flag to prevent displaying completed items.
-
Update the custom usage function to include additional instructions on how to provide new tasks to the tool.
-
Include test cases for the remaining options, such as -complete.
-
Update the tests to use the TODO_FILENAME environment variable instead of hard-coding the test file name so that it doesn’t cause conflicts with an existing file.
-
Update the getTask function allowing it to handle multiline input from STDIN. Each line should be ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access