diff --git a/src/click/types.py b/src/click/types.py index a735fbba3..c73c1a3b6 100644 --- a/src/click/types.py +++ b/src/click/types.py @@ -253,9 +253,10 @@ def to_info_dict(self) -> t.Dict[str, t.Any]: def get_metavar(self, param: "Parameter") -> str: if param.param_type_name == "option" and not param.show_choices: - choices_str = "|".join( - {convert_type(type(choice)).name.upper() for choice in self.choices} - ) + choice_metavars = [ + convert_type(type(choice)).name.upper() for choice in self.choices + ] + choices_str = "|".join([*dict.fromkeys(choice_metavars)]) else: choices_str = "|".join([str(i) for i in self.choices])