A single matched token span in the input command line.
| 33 | |
| 34 | @dataclass(frozen=True, slots=True) |
| 35 | class 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 | |
| 52 | def _option_debug(option): |
no outgoing calls
no test coverage detected