From: Zbigniew Jędrzejewski-Szmek Date: Thu, 27 Oct 2022 08:31:37 +0000 (+0200) Subject: mkosi: disallow parameter abbreviations X-Git-Tag: v14~2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce4b6a52fe346e711a5a2cbe1424a0784ad4ff52;p=thirdparty%2Fmkosi.git mkosi: disallow parameter abbreviations For interactive use, we have both short options and tab-completion. Abbreviated options are problematic because of forward-compatibility: if we add more options in the future, an older abbreviation might become non-unique and stop working. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 93005e823..5e9474175 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -4950,12 +4950,16 @@ class ArgumentParserMkosi(argparse.ArgumentParser): self._ini_file_key = "" # multi line list processing self._ini_file_list_mode = False + # we need to suppress mypy here: https://github.com/python/mypy/issues/6799 super().__init__(*kargs, # Add config files to be parsed: fromfile_prefix_chars=ArgumentParserMkosi.fromfile_prefix_chars, formatter_class=CustomHelpFormatter, + # Tweak defaults: + allow_abbrev=False, # Pass through the other options: - **kwargs) + **kwargs, + ) # type: ignore @staticmethod def _camel_to_arg(camel: str) -> str: