mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-27 21:16:14 +02:00
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:
parent
17c987c605
commit
7bd15d12ad
5 changed files with 127 additions and 18 deletions
|
@ -124,6 +124,50 @@ Feature: Searching in a journal
|
|||
| basic_folder.yaml |
|
||||
| basic_dayone.yaml |
|
||||
|
||||
|
||||
Scenario: Searching for unstarred entries
|
||||
Given we use the config "<config_file>"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl -not -starred"
|
||||
Then we should get no error
|
||||
And the output should contain "2 entries found"
|
||||
|
||||
Examples: configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
| basic_folder.yaml |
|
||||
| basic_dayone.yaml |
|
||||
|
||||
Scenario: Searching for tagged entries
|
||||
Given we use the config "<config_file>"
|
||||
And we use the password "test" if prompted
|
||||
When we run "jrnl -tagged"
|
||||
Then we should get no error
|
||||
And the output should contain "3 entries found"
|
||||
|
||||
Examples: configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
| basic_folder.yaml |
|
||||
| basic_dayone.yaml |
|
||||
|
||||
Scenario: Searching for untagged entries
|
||||
Given we use the config "empty_folder.yaml"
|
||||
When we run "jrnl Tagged entry. This one has a @tag."
|
||||
Then we should get no error
|
||||
When we run "jrnl Untagged entry. This one has no tag."
|
||||
Then we should get no error
|
||||
When we run "jrnl -not -tagged"
|
||||
Then we should get no error
|
||||
And the output should contain "1 entry found"
|
||||
And the output should contain "This one has no tag"
|
||||
|
||||
Examples: configs
|
||||
| config_file |
|
||||
| basic_onefile.yaml |
|
||||
| basic_folder.yaml |
|
||||
| basic_dayone.yaml |
|
||||
|
||||
Scenario Outline: Searching for dates
|
||||
Given we use the config "<config_file>"
|
||||
When we run "jrnl -on 2020-08-31 --short"
|
||||
|
|
|
@ -23,6 +23,8 @@ def expected_args(**kwargs):
|
|||
"change_time": None,
|
||||
"edit": False,
|
||||
"end_date": None,
|
||||
"exclude_starred": False,
|
||||
"exclude_tagged": False,
|
||||
"today_in_history": False,
|
||||
"month": None,
|
||||
"day": None,
|
||||
|
@ -38,6 +40,7 @@ def expected_args(**kwargs):
|
|||
"starred": False,
|
||||
"start_date": None,
|
||||
"strict": False,
|
||||
"tagged": False,
|
||||
"tags": False,
|
||||
"text": [],
|
||||
"config_override": [],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue