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

Method positionals

explainshell/models.py:118–132  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

116
117 @property
118 def positionals(self):
119 # go over all options and look for those with the same 'positional'
120 # field; prefix-bearing positionals are excluded from ordered
121 # consumption — they can only be claimed by a token carrying their
122 # prefix (see prefixed_positionals)
123 groups = collections.OrderedDict()
124 for opt in self.options:
125 if opt.positional and not opt.prefix:
126 groups.setdefault(opt.positional, []).append(opt)
127
128 # merge all the options under the same argument to a single string
129 for k, ln in groups.items():
130 groups[k] = "\n\n".join([p.text for p in ln])
131
132 return groups
133
134 @property
135 def prefixed_positionals(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected