diff --git a/jrnl.py b/jrnl.py index cb85f88b..2cfbeb0f 100755 --- a/jrnl.py +++ b/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