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

Method collect_usage_pieces

src/click/core.py:1132–1141  ·  view source on GitHub ↗

Returns all the pieces that go into the usage line and returns it as a list of strings.

(self, ctx: Context)

Source from the content-addressed store, hash-verified

1130 formatter.write_usage(ctx.command_path, " ".join(pieces))
1131
1132 def collect_usage_pieces(self, ctx: Context) -> list[str]:
1133 """Returns all the pieces that go into the usage line and returns
1134 it as a list of strings.
1135 """
1136 rv = [self.options_metavar] if self.options_metavar else []
1137
1138 for param in self.get_params(ctx):
1139 rv.extend(param.get_usage_pieces(ctx))
1140
1141 return rv
1142
1143 def get_help_option_names(self, ctx: Context) -> list[str]:
1144 """Returns the names for the help option."""

Callers 1

format_usageMethod · 0.95

Calls 2

get_paramsMethod · 0.95
get_usage_piecesMethod · 0.45

Tested by

no test coverage detected