a class to group matchresults together we group all shell results in one group and create a new group for every command
| 11 | |
| 12 | @dataclass |
| 13 | class MatchGroup: |
| 14 | """a class to group matchresults together |
| 15 | |
| 16 | we group all shell results in one group and create a new group for every |
| 17 | command""" |
| 18 | |
| 19 | name: str |
| 20 | results: list = field(default_factory=list) |
| 21 | manpage: object = None |
| 22 | suggestions: list | None = None |
| 23 | error: Exception | None = None |
| 24 | # Tracks how many ordered positional arguments have been consumed for |
| 25 | # this command group. Each unmatched word advances the index so the |
| 26 | # next positional definition is used; once exhausted, the last |
| 27 | # positional is reused (variadic). |
| 28 | positional_index: int = field(default=0, repr=False) |
| 29 | |
| 30 | def __repr__(self): |
| 31 | return "<matchgroup %r with %d results>" % (self.name, len(self.results)) |
| 32 | |
| 33 | |
| 34 | @dataclass(frozen=True, slots=True) |
no outgoing calls
no test coverage detected