mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
optparse: improve HelpFormatter annotations (#13278)
This commit is contained in:
@@ -62,9 +62,11 @@ class HelpFormatter:
|
||||
max_help_position: int
|
||||
option_strings: dict[Option, str]
|
||||
parser: OptionParser
|
||||
short_first: Incomplete
|
||||
short_first: bool | Literal[0, 1]
|
||||
width: int
|
||||
def __init__(self, indent_increment: int, max_help_position: int, width: int | None, short_first: int) -> None: ...
|
||||
def __init__(
|
||||
self, indent_increment: int, max_help_position: int, width: int | None, short_first: bool | Literal[0, 1]
|
||||
) -> None: ...
|
||||
def dedent(self) -> None: ...
|
||||
def expand_default(self, option: Option) -> str: ...
|
||||
def format_description(self, description: str | None) -> str: ...
|
||||
@@ -83,14 +85,22 @@ class HelpFormatter:
|
||||
|
||||
class IndentedHelpFormatter(HelpFormatter):
|
||||
def __init__(
|
||||
self, indent_increment: int = 2, max_help_position: int = 24, width: int | None = None, short_first: int = 1
|
||||
self,
|
||||
indent_increment: int = 2,
|
||||
max_help_position: int = 24,
|
||||
width: int | None = None,
|
||||
short_first: bool | Literal[0, 1] = 1,
|
||||
) -> None: ...
|
||||
def format_heading(self, heading: str) -> str: ...
|
||||
def format_usage(self, usage: str) -> str: ...
|
||||
|
||||
class TitledHelpFormatter(HelpFormatter):
|
||||
def __init__(
|
||||
self, indent_increment: int = 0, max_help_position: int = 24, width: int | None = None, short_first: int = 0
|
||||
self,
|
||||
indent_increment: int = 0,
|
||||
max_help_position: int = 24,
|
||||
width: int | None = None,
|
||||
short_first: bool | Literal[0, 1] = 0,
|
||||
) -> None: ...
|
||||
def format_heading(self, heading: str) -> str: ...
|
||||
def format_usage(self, usage: str) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user