fix: properly detect flags after -link and -date

Previously, /edit 28 -link -date would treat -date as the link value.
Now it checks if the next argument starts with "-" to detect flags.
This commit is contained in:
shokollm
2026-04-05 01:57:56 +00:00
parent 6c99751827
commit 442e5279cc

View File

@@ -106,14 +106,14 @@ def parse_args(
arg = args[i]
if arg == "-link":
if i + 1 < len(args):
if i + 1 < len(args) and not args[i + 1].startswith("-"):
link = args[i + 1]
i += 2
else:
clear_link = True
i += 1
elif arg == "-date":
if i + 1 < len(args):
if i + 1 < len(args) and not args[i + 1].startswith("-"):
due_date_ts = parse_date_with_tz(args[i + 1])
if due_date_ts is not None:
i += 2