diff --git a/src/click/parser.py b/src/click/parser.py index 1ea1f7166e..713c4a2c77 100644 --- a/src/click/parser.py +++ b/src/click/parser.py @@ -401,7 +401,9 @@ def _match_short_opt(self, arg: str, state: _ParsingState) -> None: if self.ignore_unknown_options: unknown_options.append(ch) continue - raise NoSuchOption(opt, ctx=self.ctx) + raise NoSuchOption( + _normalize_opt(arg, self.ctx), ctx=self.ctx + ) # Fix #2779 if option.takes_value: # Any characters left in arg? Pretend they're the # next arg, and stop consuming characters of arg.