Normalize args so compile is the default command.
(args: Optional[List[str]])
| 671 | |
| 672 | |
| 673 | def normalize_args(args: Optional[List[str]]) -> List[str]: |
| 674 | """Normalize args so compile is the default command.""" |
| 675 | if args is None: |
| 676 | args = sys.argv[1:] |
| 677 | if not args: |
| 678 | return [] |
| 679 | if args[0] in {"-h", "--help"}: |
| 680 | return args |
| 681 | if args[0] == "--scan-generated": |
| 682 | return args |
| 683 | if args[0] == "scan-generated": |
| 684 | return ["--scan-generated", *args[1:]] |
| 685 | if args[0] == "compile": |
| 686 | return args[1:] |
| 687 | return args |
| 688 | |
| 689 | |
| 690 | def get_languages(lang_arg: str) -> List[str]: |