mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 08:38:32 +02:00
Support for -and for strict search
This commit is contained in:
parent
c6f324e5d4
commit
e8b2bf25a5
1 changed files with 2 additions and 1 deletions
3
jrnl.py
3
jrnl.py
|
@ -192,6 +192,7 @@ if __name__ == "__main__":
|
|||
reading = parser.add_argument_group('Reading', 'Specifying either of these parameters will display posts of your journal')
|
||||
reading.add_argument('-from', dest='start_date', metavar="date", help='View entries after this date')
|
||||
reading.add_argument('-to', dest='end_date', metavar="date", help='View entries before this date')
|
||||
reading.add_argument('-and', dest='strict', action="store_true", help='Filter by tags using AND (default: OR)')
|
||||
reading.add_argument('-n', dest='limit', default=None, metavar="N", help='Shows the last n entries matching the filter', nargs="?", type=int)
|
||||
args = parser.parse_args()
|
||||
|
||||
|
@ -223,6 +224,6 @@ if __name__ == "__main__":
|
|||
journal.write()
|
||||
|
||||
else: # read mode
|
||||
journal.filter(tags=args.text, start_date=args.start_date, end_date=args.end_date)
|
||||
journal.filter(tags=args.text, start_date=args.start_date, end_date=args.end_date, strict=args.strict)
|
||||
journal.limit(args.limit)
|
||||
print journal
|
||||
|
|
Loading…
Add table
Reference in a new issue