(program : ArgumentParser)
| 10 | |
| 11 | |
| 12 | def validate_args(program : ArgumentParser) -> bool: |
| 13 | if validate_actions(program): |
| 14 | for action in program._actions: |
| 15 | if isinstance(action, _SubParsersAction): |
| 16 | for _, sub_program in action._name_parser_map.items(): |
| 17 | if not validate_args(sub_program): |
| 18 | return False |
| 19 | return True |
| 20 | return False |
| 21 | |
| 22 | |
| 23 | def validate_actions(program : ArgumentParser) -> bool: |