Main function for command line usage.
()
| 417 | |
| 418 | |
| 419 | def main(): |
| 420 | """Main function for command line usage.""" |
| 421 | parser = argparse.ArgumentParser( |
| 422 | description="Analyze build_info.json files to extract platform information", |
| 423 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 424 | epilog=""" |
| 425 | Examples: |
| 426 | %(prog)s --list-boards # List all available boards |
| 427 | %(prog)s --board uno --show-defines # Show UNO platform defines |
| 428 | %(prog)s --board esp32dev --show-compiler # Show ESP32 compiler info |
| 429 | %(prog)s --board teensy31 --show-all # Show all info for Teensy 3.1 |
| 430 | %(prog)s --compare uno esp32dev # Compare defines between boards |
| 431 | """, |
| 432 | ) |
| 433 | |
| 434 | parser.add_argument( |
| 435 | "--build-dir", |
| 436 | default=".build", |
| 437 | help="Build directory containing platform subdirectories (default: .build)", |
| 438 | ) |
| 439 | |
| 440 | parser.add_argument( |
| 441 | "--list-boards", |
| 442 | action="store_true", |
| 443 | help="List all boards with build_info.json files", |
| 444 | ) |
| 445 | |
| 446 | parser.add_argument( |
| 447 | "--board", help="Board name to analyze (e.g., uno, esp32dev, teensy31)" |
| 448 | ) |
| 449 | |
| 450 | parser.add_argument( |
| 451 | "--show-defines", action="store_true", help="Show platform preprocessor defines" |
| 452 | ) |
| 453 | |
| 454 | parser.add_argument( |
| 455 | "--show-compiler", action="store_true", help="Show compiler information" |
| 456 | ) |
| 457 | |
| 458 | parser.add_argument( |
| 459 | "--show-toolchain", action="store_true", help="Show toolchain aliases" |
| 460 | ) |
| 461 | |
| 462 | parser.add_argument( |
| 463 | "--show-all", action="store_true", help="Show all available information" |
| 464 | ) |
| 465 | |
| 466 | parser.add_argument( |
| 467 | "--compare", |
| 468 | nargs=2, |
| 469 | metavar=("BOARD1", "BOARD2"), |
| 470 | help="Compare platform defines between two boards", |
| 471 | ) |
| 472 | |
| 473 | parser.add_argument( |
| 474 | "--json", action="store_true", help="Output results in JSON format" |
| 475 | ) |
| 476 |
no test coverage detected