CLI entry point.
()
| 16 | |
| 17 | |
| 18 | def main() -> int: |
| 19 | """CLI entry point.""" |
| 20 | parser = create_parser() |
| 21 | args = parser.parse_args() |
| 22 | |
| 23 | try: |
| 24 | if args.command == 'process': |
| 25 | return process_command(args) |
| 26 | elif args.command == 'version': |
| 27 | print(f"OneCite version {__version__}") |
| 28 | return 0 |
| 29 | else: |
| 30 | parser.print_help() |
| 31 | return 1 |
| 32 | |
| 33 | except OneCiteError as e: |
| 34 | print(f"Error: {e}", file=sys.stderr) |
| 35 | return 1 |
| 36 | except Exception as e: |
| 37 | print(f"Processing failed: {e}", file=sys.stderr) |
| 38 | return 1 |
| 39 | |
| 40 | |
| 41 | def create_parser() -> argparse.ArgumentParser: |
no test coverage detected