quill: fix duplicate subparser in todo.py

This commit is contained in:
quill committed 2026-10-26 18:19:49 +00:00
1 parent f30ea760c3
commit b2fb4ccf7c
1 file changed
+4 -4
+4 -4
View File
@@ -67,9 +67,8 @@ def main():
a.add_argument("task", help="task text")
sub.add_parser("list", help="show todos")
sub.add_parser("all", help="show all including done")
sub.add_parser("done", help="show done only")
d = sub.add_parser("done")
d.add_argument("id", type=int, help="todo id to mark done")
d = sub.add_parser("done", help="show done only or mark todo done by id")
d.add_argument("id", type=int, nargs="?", help="todo id to mark done")
args = p.parse_args()
if args.cmd == "add":
cmd_add(args)
@@ -78,9 +77,10 @@ def main():
elif args.cmd == "all":
cmd_list(args)
elif args.cmd == "done":
if hasattr(args, "id"):
if args.id is not None:
cmd_done(args)
else:
args.done_only = True
cmd_list(args)
else:
p.print_help()