MCPcopy Create free account
hub / github.com/idank/explainshell / prefixed_positionals

Method prefixed_positionals

explainshell/models.py:135–147  ·  view source on GitHub ↗

ordered mapping of positional name -> (prefix, merged help text) for positionals that declare a literal token prefix

(self)

Source from the content-addressed store, hash-verified

133
134 @property
135 def prefixed_positionals(self):
136 """ordered mapping of positional name -> (prefix, merged help text)
137 for positionals that declare a literal token prefix"""
138 groups = collections.OrderedDict()
139 for opt in self.options:
140 if opt.positional and opt.prefix:
141 groups.setdefault(opt.positional, []).append(opt)
142
143 merged = collections.OrderedDict()
144 for k, ln in groups.items():
145 merged[k] = (ln[0].prefix, "\n\n".join([p.text for p in ln]))
146
147 return merged
148
149 def find_option(self, flag):
150 for o_tmp in self.options:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected