MCPcopy
hub / github.com/fastapi/typer / show

Method show

typer/_click/exceptions.py:60–79  ·  view source on GitHub ↗
(self, file: IO[Any] | None = None)

Source from the content-addressed store, hash-verified

58 self.cmd: Command | None = self.ctx.command if self.ctx else None
59
60 def show(self, file: IO[Any] | None = None) -> None:
61 if file is None:
62 file = get_text_stderr()
63 color = None
64 hint = ""
65 if (
66 self.ctx is not None
67 and self.ctx.command.get_help_option(self.ctx) is not None
68 ):
69 command = self.ctx.command_path
70 option = self.ctx.help_option_names[0]
71 hint = f"Try '{command} {option}' for help.\n"
72 if self.ctx is not None:
73 color = self.ctx.color
74 echo(f"{self.ctx.get_usage()}\n{hint}", file=file, color=color)
75 echo(
76 f"Error: {self.format_message()}",
77 file=file,
78 color=color,
79 )
80
81
82class BadParameter(UsageError):

Callers 1

_mainFunction · 0.45

Calls 5

get_text_stderrFunction · 0.85
echoFunction · 0.85
get_help_optionMethod · 0.80
get_usageMethod · 0.45
format_messageMethod · 0.45

Tested by

no test coverage detected