diff --git a/open-todo-txt.py b/open-todo-txt.py index e7aa47a..5e795c6 100755 --- a/open-todo-txt.py +++ b/open-todo-txt.py @@ -62,7 +62,7 @@ def process_file(options): if lines_to_delete: delete_lines_from_file(fname, lines_to_delete, options.dryrun) - if not today_exists: + if not today_exists and options.taskwarrior_fill_today: add_today(fname, options) diff --git a/options.py b/options.py index 2e3cd4c..1dd9475 100644 --- a/options.py +++ b/options.py @@ -12,6 +12,7 @@ class Options: dryrun: bool = False taskwarrior_log_completed: bool = True taskwarrior_add_incomplete: bool = True + taskwarrior_fill_today: bool = True # can not yet be changed taskwarrior_overrides: List = field( @@ -56,6 +57,12 @@ def parse_cmdline_args(options): help="don't add incomplete todo items to taskwarrior", action="store_true", ) + parser.add_argument( + "-T", + "--nofilltoday", + help="don't add today's todo items as entry to file", + action="store_true", + ) args = parser.parse_args() if args.dryrun: @@ -64,6 +71,8 @@ def parse_cmdline_args(options): options.taskwarrior_log_completed = False if args.noincomplete: options.taskwarrior_add_incomplete = False + if args.nofilltoday: + options.taskwarrior_fill_today = False if args.file: options.jrnl_fname = args.file if args.blocktitle: