Format: application/octet-stream
1 from typing import Any, List, Mapping, Optional, Tuple, Union, overload
2
3 _Option = Tuple[str, Optional[str], str]
4 _GR = Tuple[List[str], OptionDummy]
5
6 def fancy_getopt(
7 options: List[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: Optional[List[str]]
8 ) -> Union[List[str], _GR]: ...
9 def wrap_text(text: str, width: int) -> List[str]: ...
10
11 class FancyGetopt:
12 def __init__(self, option_table: Optional[List[_Option]] = ...) -> None: ...
13 # TODO kinda wrong, `getopt(object=object())` is invalid
14 @overload
15 def getopt(self, args: Optional[List[str]] = ...) -> _GR: ...
16 @overload
17 def getopt(self, args: Optional[List[str]], object: Any) -> List[str]: ...
18 def get_option_order(self) -> List[Tuple[str, str]]: ...
19 def generate_help(self, header: Optional[str] = ...) -> List[str]: ...
20
21 class OptionDummy: ...
22