HACK Add option for today entry in file

This commit is contained in:
Marty Oehme 2021-10-31 18:44:09 +01:00
parent 08e73398e9
commit 38984a1688
Signed by: Marty
GPG key ID: B7538B8F50A1C800
2 changed files with 10 additions and 1 deletions

View file

@ -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)

View file

@ -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: