Add '-not' flag for excluding tags from filter

Add tests for the excluding tags with -not
This commit is contained in:
Justin Proffitt 2019-07-28 21:57:53 -04:00
parent bd806efb98
commit c249c8ded9
3 changed files with 42 additions and 3 deletions

View file

@ -39,6 +39,7 @@ def parse_args(args=None):
reading.add_argument('-and', dest='strict', action="store_true", help='Filter by tags using AND (default: OR)')
reading.add_argument('-starred', dest='starred', action="store_true", help='Show only starred entries')
reading.add_argument('-n', dest='limit', default=None, metavar="N", help="Shows the last n entries matching the filter. '-n 3' and '-3' have the same effect.", nargs="?", type=int)
reading.add_argument('-not', dest='excluded', nargs='+', default=[], metavar="E", help="Exclude entries with these tags")
exporting = parser.add_argument_group('Export / Import', 'Options for transmogrifying your journal')
exporting.add_argument('-s', '--short', dest='short', action="store_true", help='Show only titles or line containing the search tags')
@ -239,7 +240,8 @@ def run(manual_args=None):
start_date=args.start_date, end_date=args.end_date,
strict=args.strict,
short=args.short,
starred=args.starred)
starred=args.starred,
exclude=args.excluded)
journal.limit(args.limit)
# Reading mode