(self)
| 89 | return outputs |
| 90 | |
| 91 | def parse(self) -> DataClassType | Tuple[DataClassType]: |
| 92 | if len(sys.argv) == 2 and sys.argv[1].endswith(".yaml"): |
| 93 | # If we pass only one argument to the script and it's the path to a YAML file, |
| 94 | # let's parse it to get our arguments. |
| 95 | output = self.parse_yaml_file(os.path.abspath(sys.argv[1])) |
| 96 | # parse command line args and yaml file |
| 97 | elif len(sys.argv) > 2 and sys.argv[1].endswith(".yaml"): |
| 98 | output = self.parse_yaml_and_args(os.path.abspath(sys.argv[1]), sys.argv[2:]) |
| 99 | # parse command line args only |
| 100 | else: |
| 101 | output = self.parse_args_into_dataclasses() |
| 102 | |
| 103 | if len(output) == 1: |
| 104 | output = output[0] |
| 105 | return output |
| 106 | |
| 107 | |
| 108 | @dataclass |
no test coverage detected