Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement search command #52

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

Pyxels
Copy link
Contributor

@Pyxels Pyxels commented May 7, 2024

This adds the search subcommand to search (case-insensitive) for strings in the descriptions and projects.

Problem

I found myself looking for descriptions to continue that weren't in the last 10 and I didn't know the exact wording of. Before, I usually opened the bartib file and searched there.

Solution

One can use bartib search <TERM> to search for a string in the description/project. All description/project pairs are returned that contain said <TERM>.

Examples

Example Images

image

image

image

Notes

I had to somewhat refactor the list_descriptions_and_projects function to avoid code repetition, please let me know if you'd like this handled differently.

Not sure if this is something you'd like, feel free to close/change.

@nikolassv
Copy link
Owner

Thank you for your pull request! This appears to be a useful feature. Unfortunately, I have not had the time yet to take a closer look. I will come back to it, as soon as I can

@nikolassv
Copy link
Owner

I really like the feature! I just added two minor changes:

  • The search term can now contain wildcards "*" or "?"
  • The search term is now required (a search without a term does not make much sense)

@nikolassv nikolassv merged commit 60b9865 into nikolassv:master Jun 13, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants