Let's use the usual method for passing mixed inherited and local keyword args.
We don't need to put the argument names in quotes so this looks nicer. Also,
if we were to make a mistake and pass the same kwargs in two places, previously
the local assignment would silently override the other value. But that seems
inverted because now the base class overwrites something specified by the daughter
class. Anyway, it's better to throw an error, which we now will do:
TypeError: argparse.ArgumentParser.__init__() got multiple values for keyword argument '…'
self._ini_file_key = "" # multi line list processing
self._ini_file_list_mode = False
- # Add config files to be parsed
- kwargs["fromfile_prefix_chars"] = ArgumentParserMkosi.fromfile_prefix_chars
- kwargs["formatter_class"] = CustomHelpFormatter
-
- super().__init__(*kargs, **kwargs)
+ super().__init__(*kargs,
+ # Add config files to be parsed:
+ fromfile_prefix_chars=ArgumentParserMkosi.fromfile_prefix_chars,
+ formatter_class=CustomHelpFormatter,
+ # Pass through the other options:
+ **kwargs)
@staticmethod
def _camel_to_arg(camel: str) -> str: