| 320 | |
| 321 | |
| 322 | def parse_args() -> argparse.Namespace: |
| 323 | parser = argparse.ArgumentParser( |
| 324 | description="Run include-what-you-use on the project" |
| 325 | ) |
| 326 | parser.add_argument("board", nargs="?", help="Board to check (optional)") |
| 327 | parser.add_argument( |
| 328 | "--fix", |
| 329 | action="store_true", |
| 330 | help="Automatically apply suggested fixes using fix_includes", |
| 331 | ) |
| 332 | parser.add_argument( |
| 333 | "--mapping-file", |
| 334 | action="append", |
| 335 | help="Additional mapping file to use (can be specified multiple times)", |
| 336 | ) |
| 337 | parser.add_argument( |
| 338 | "--max-line-length", |
| 339 | type=int, |
| 340 | default=100, |
| 341 | help="Maximum line length for suggestions (default: 100)", |
| 342 | ) |
| 343 | parser.add_argument("--verbose", action="store_true", help="Enable verbose output") |
| 344 | parser.add_argument( |
| 345 | "--quiet", |
| 346 | action="store_true", |
| 347 | help="Suppress verbose output (show only essential status)", |
| 348 | ) |
| 349 | parser.add_argument( |
| 350 | "--json", |
| 351 | action="store_true", |
| 352 | help="Output results as JSON (header scan mode only)", |
| 353 | ) |
| 354 | parser.add_argument( |
| 355 | "--file", |
| 356 | help="Check a single file instead of scanning all headers", |
| 357 | ) |
| 358 | parser.add_argument( |
| 359 | "--no-cache", |
| 360 | action="store_true", |
| 361 | help="Bypass per-file result cache (force full re-scan)", |
| 362 | ) |
| 363 | return parser.parse_args() |
| 364 | |
| 365 | |
| 366 | # --------------------------------------------------------------------------- |