MCPcopy
hub / github.com/idank/explainshell / MatchResult

Class MatchResult

explainshell/matcher.py:35–49  ·  view source on GitHub ↗

A single matched token span in the input command line.

Source from the content-addressed store, hash-verified

33
34@dataclass(frozen=True, slots=True)
35class MatchResult:
36 """A single matched token span in the input command line."""
37
38 start: int # start position in the input string
39 end: int # end position in the input string (exclusive)
40 text: str | None # help text from the manpage option, or None if unknown
41 match: str | None # the matched portion of the input string
42 # Debug metadata for the explain.html debug panel; excluded from
43 # equality/hashing. Every creation site populates this with a dict
44 # whose "kind" key describes the match type.
45 debug_info: dict | None = field(default=None, compare=False, hash=False)
46
47 @property
48 def unknown(self):
49 return self.text is None
50
51
52def _option_debug(option):

Callers 15

unknownMethod · 0.85
visitreservedwordMethod · 0.85
visitoperatorMethod · 0.85
visitpipeMethod · 0.85
visitredirectMethod · 0.85
visitcommandMethod · 0.85
visitforMethod · 0.85
startcommandMethod · 0.85
visitassignmentMethod · 0.85
attemptfuzzyMethod · 0.85
_visitwordMethod · 0.85
visitfunctionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected