By default, the show command shows only incomplete items, so the user has to execute the reminders show Todo --only-completed command to retrieve completed items and their numbers. Then, the reminders uncomplete Todo 9 command can be called to switch it back to the incomplete state.
Please bear in mind that I have 0 knowledge of Swift. I tried to make some changes and came up with this solution. I have tested it locally, and everything seems to be working.
Since the uncomplete operation uses the same flag field as the complete operation (isCompleted), instead of duplicating the complete function in Reminders.swift, I used the same function by just making it a parameter. Please review and let me know if there is anything that needs to be changed.
By default, the
show
command shows onlyincomplete
items, so the user has to execute thereminders show Todo --only-completed
command to retrieve completed items and their numbers. Then, thereminders uncomplete Todo 9
command can be called to switch it back to theincomplete
state.Please bear in mind that I have 0 knowledge of Swift. I tried to make some changes and came up with this solution. I have tested it locally, and everything seems to be working.
Since the
uncomplete
operation uses the same flag field as thecomplete
operation (isCompleted), instead of duplicating the complete function inReminders.swift
, I used the same function by just making it a parameter. Please review and let me know if there is anything that needs to be changed.