Add search Command for Simplified Task Filtering #450
+31
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
###Pull Request Description:
This pull request introduces a new search command to the todo.txt-cli, designed to simplify the task filtering process.
###Problem:
The existing list command is versatile but can be complex for users when filtering tasks using multiple terms or regex. This complexity can deter new users from effectively using the CLI.
###Solution:
Introduced a new search command to make task filtering simple and intuitive.
The search command allows users to find tasks by specifying keywords directly, without requiring complex syntax.
###Example usage:
todo.sh search "keyword"
This displays all tasks containing the specified keyword(s).
Changes Made:
todo.sh:
Added a search action in the command handler.
Implemented filtering logic using grep to find matching tasks from todo.txt.
###Test Cases:
Created a new file test/search.test with test cases to ensure the functionality works correctly.
Verified edge cases such as no matches or invalid input.
###Documentation:
Updated README.md to include usage examples for the new search command.
###Example Output:
Input:
todo.sh search "meeting"
Output:
3 (A) Prepare for team meeting +work @office
7 Follow up after client meeting +work @email
###Impact:
Simplifies task filtering for users, especially beginners.
Improves the overall user experience and aligns with the goal of simplifying task management.
###Fixes #445