Skip to content
Myr

repr is erasing ANSI escapes codes

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Adrien Pensart · committed by David Lord · parent 1059c20 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:src/click/core.py+2 added-2 removed
2370 unmodified lines
2371 """Get a stringified version of the param for use in error messages to2372 indicate which param caused the error.2373 """2374 hint_list = self.opts or [self.human_readable_name]2375 return " / ".join(repr(x) for x in hint_list)2375 return " / ".join(f"'{x}'" for x in hint_list)23762377 def shell_complete(self, ctx: Context, incomplete: str) -> t.List["CompletionItem"]:2378 """Return a list of completions for the incomplete value. If a2379 ``shell_complete`` function was given during init, it is used.
545 unmodified lines
2925 def get_usage_pieces(self, ctx: Context) -> t.List[str]:2926 return [self.make_metavar()]29272928 def get_error_hint(self, ctx: Context) -> str:2929 return repr(self.make_metavar())2929 return f"'{self.make_metavar()}'"29302931 def add_to_parser(self, parser: OptionParser, ctx: Context) -> None:2932 parser.add_argument(dest=self.name, nargs=self.nargs, obj=self)