(args: argparse.Namespace)
| 334 | |
| 335 | |
| 336 | def cmd_reset(args: argparse.Namespace) -> int: |
| 337 | state = read_state() |
| 338 | target_id = args.section_id |
| 339 | found = False |
| 340 | for chapter, section in iter_sections(state): |
| 341 | if section["id"] == target_id: |
| 342 | found = True |
| 343 | section["status"] = "pending" |
| 344 | section.pop("note", None) |
| 345 | chapter["status"] = recompute_chapter_status(chapter) |
| 346 | break |
| 347 | if not found: |
| 348 | raise ValueError(f"Unknown section id: {target_id}") |
| 349 | |
| 350 | write_state(state) |
| 351 | print(f"Reset to pending: {target_id}") |
| 352 | return 0 |
| 353 | |
| 354 | |
| 355 | def cmd_export(_args: argparse.Namespace) -> int: |
nothing calls this directly
no test coverage detected