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

Search for entries with no tags or stars with -not -starred and -not -tagged #1663

Merged
merged 2 commits into from
Jan 28, 2023

Conversation

cjcon90
Copy link
Contributor

@cjcon90 cjcon90 commented Jan 12, 2023

This aims to fix #1057 - Filter for entries with no tags

As discussed in that issue, the preferred syntax is -not -starred & -not -tagged, as this feels the most intuitive

I aimed to change the existing functionality as little as possible, but making this syntax fit did necessitate some minor changes:

  • Add a -tagged flag, to show only tagged entries
  • Alter -not to be allowed to take 0-1 arguments
  • Manage parsing in case proceeded by -starred or -tagged
  • If not is not followed by either tag, and is empty, then return the error we would normally get

Note: While I agree that -not -starred etc is the most intuitive syntax (it's what I instinctively tried initially), I'm not crazy about the double usage for the -not flag. Ideally each flag should only do one thing, but if we want to go a different route I can take a look at that also :-)

Checklist

  • I have read the contributing doc.
  • I have included a link to the relevant issue number.
  • I have checked to ensure there aren't other open pull requests
    for the same issue.
  • I have written new tests for these changes, as needed.

Copy link
Member

@micahellison micahellison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to jrnl, and thank you for the very complete and thoughtful PR! I like the overall approach you took, and I appreciate the new tests as well.

I just have a couple minor nitpicks around spelling/wording, but I don't think this needs any major changes.

jrnl/args.py Outdated Show resolved Hide resolved
jrnl/args.py Outdated Show resolved Hide resolved
@cjcon90
Copy link
Contributor Author

cjcon90 commented Jan 14, 2023

@micahellison thank you! Updated both.

Happy to be able to contribute - just started using it daily and really love the app :-)

@wren
Copy link
Member

wren commented Jan 14, 2023

@cjcon90 Hi! We didn't expect you to respond so quickly, and just now merged another PR that will likely cause another merge conflict. Sorry about that!

As soon as that's fixed, we'll get yours merged in. Thanks for the great work!

@cjcon90
Copy link
Contributor Author

cjcon90 commented Jan 27, 2023

Sorry meant to do this earlier and completely went out of my head! Rebased my changes so hopefully ready to merge :-)

@micahellison
Copy link
Member

Thanks for the PR and changes! Looks good to me. This still needs to be documented, but I've filled that in a separate issue #1668.

@micahellison micahellison added the enhancement New feature or request label Jan 28, 2023
@micahellison micahellison changed the title Filter for tagged, untagged and unstarred (#1057) Search for entries with no tags or stars with -not -starred and -not -tagged Jan 28, 2023
@micahellison micahellison merged commit 7bd15d1 into jrnl-org:develop Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search for entries with no tags or stars with -not -starred and -not -tagged
3 participants