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

* Allow for `-not -starred` to search for unstarred entries

* Add `-tagged` and `-not -tagged` functionality
This commit is contained in:
Ciaran Concannon 2023-01-28 19:45:01 +00:00 committed by GitHub
parent 17c987c605
commit 7bd15d12ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 127 additions and 18 deletions

View file

@ -89,6 +89,8 @@ def _is_write_mode(args: "Namespace", config: dict, **kwargs) -> bool:
args.edit,
args.change_time,
args.excluded,
args.exclude_starred,
args.exclude_tagged,
args.export,
args.end_date,
args.today_in_history,
@ -101,6 +103,7 @@ def _is_write_mode(args: "Namespace", config: dict, **kwargs) -> bool:
args.starred,
args.start_date,
args.strict,
args.tagged,
args.tags,
)
)
@ -270,7 +273,10 @@ def _has_search_args(args: "Namespace") -> bool:
args.end_date,
args.strict,
args.starred,
args.tagged,
args.excluded,
args.exclude_starred,
args.exclude_tagged,
args.contains,
args.limit,
)
@ -296,7 +302,10 @@ def _filter_journal_entries(args: "Namespace", journal: Journal, **kwargs) -> No
end_date=args.end_date,
strict=args.strict,
starred=args.starred,
tagged=args.tagged,
exclude=args.excluded,
exclude_starred=args.exclude_starred,
exclude_tagged=args.exclude_tagged,
contains=args.contains,
)
journal.limit(args.limit)