| 463 | |
| 464 | |
| 465 | def parse_args(argv: Optional[List[str]] = None) -> argparse.Namespace: |
| 466 | parser = argparse.ArgumentParser(description="Add one RSS/Atom feed into tiny.opml.") |
| 467 | parser.add_argument("--tiny", default="tiny.opml", help="Path to tiny.opml") |
| 468 | parser.add_argument("--url", help="RSS/Atom URL; interactive prompt if omitted") |
| 469 | parser.add_argument("--category", help="Target category; interactive prompt if omitted") |
| 470 | parser.add_argument("--timeout", type=float, default=12, help="HTTP timeout in seconds") |
| 471 | parser.add_argument( |
| 472 | "--update", |
| 473 | action="store_true", |
| 474 | help="Update existing feed if URL already exists (title, htmlUrl, and category)", |
| 475 | ) |
| 476 | parser.add_argument( |
| 477 | "--no-git-pull", |
| 478 | action="store_true", |
| 479 | help="Skip the startup git pull --ff-only step", |
| 480 | ) |
| 481 | return parser.parse_args(argv) |
| 482 | |
| 483 | |
| 484 | def main(argv: Optional[List[str]] = None) -> int: |