MCPcopy
hub / github.com/pallets/click / get_short_help_str

Method get_short_help_str

src/click/core.py:1194–1208  ·  view source on GitHub ↗

Gets short help for the command or makes it by shortening the long help string.

(self, limit: int = 45)

Source from the content-addressed store, hash-verified

1192 return formatter.getvalue().rstrip("\n")
1193
1194 def get_short_help_str(self, limit: int = 45) -> str:
1195 """Gets short help for the command or makes it by shortening the
1196 long help string.
1197 """
1198 if self.short_help:
1199 text = inspect.cleandoc(self.short_help)
1200 elif self.help:
1201 text = make_default_short_help(self.help, limit)
1202 else:
1203 text = ""
1204
1205 if self.deprecated:
1206 text = f"{_(text)} {_format_deprecated_label(self.deprecated)}"
1207
1208 return text.strip()
1209
1210 def format_help(self, ctx: Context, formatter: HelpFormatter) -> None:
1211 """Writes the help into the formatter if it exists.

Callers 3

shell_completeMethod · 0.80
format_commandsMethod · 0.80
shell_completeMethod · 0.80

Calls 2

make_default_short_helpFunction · 0.85
_format_deprecated_labelFunction · 0.85

Tested by

no test coverage detected