-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathargdeco.pyi
156 lines (134 loc) · 4.06 KB
/
argdeco.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import argparse
from argparse import (_N, _SUPPRESS_T, _T, Action, FileType, Namespace,
_ActionsContainer, _ArgumentParserT, _FormatterClass,
_NArgsStr, _SubParsersAction)
from typing import Any, Callable, Iterable, Sequence, TypeVar, overload
_R = TypeVar("_R")
class ArgumentParser(argparse.ArgumentParser):
__wrapped__: Callable[..., _R]
container: _ActionsContainer
subparsers: _SubParsersAction | None
def __init__(
self,
wrapped: Callable,
prog: str | None = None,
usage: str | None = None,
description: str | None = None,
epilog: str | None = None,
parents: Sequence[_ArgumentParserT] = [],
formatter_class: _FormatterClass = ...,
prefix_chars: str = "-",
fromfile_prefix_chars: str | None = None,
argument_default: Any = None,
conflict_handler: str = "error",
add_help: bool = True,
allow_abbrev: bool = True,
exit_on_error: bool = True,
) -> None: ...
@overload
def __call__(
self,
args: Sequence[str] | None = None,
namespace: Namespace | None = None
) -> _R: ...
@overload
def __call__(
self,
args: Sequence[str] | None,
namespace: _N
) -> _R: ...
@overload
def __call__(
self,
*,
namespace: _N
) -> _R: ...
def argument_parser(
prog: str | None = None,
usage: str | None = None,
description: str | None = None,
epilog: str | None = None,
parents: Sequence[_ArgumentParserT] = [],
formatter_class: _FormatterClass = ...,
prefix_chars: str = "-",
fromfile_prefix_chars: str | None = None,
argument_default: Any = None,
conflict_handler: str = "error",
add_help: bool = True,
allow_abbrev: bool = True,
exit_on_error: bool = True,
) -> Callable[[Callable], ArgumentParser]: ...
def add_argument(
*name_or_flags: str,
action: _ActionStr | type[Action] = ...,
nargs: int | _NArgsStr | _SUPPRESS_T = ...,
const: Any = ...,
default: Any = ...,
type: Callable[[str], _T] | FileType = ...,
choices: Iterable[_T] | None = ...,
required: bool = ...,
help: str | None = ...,
metavar: str | tuple[str, ...] | None = ...,
dest: str | None = ...,
version: str = ...,
**kwargs: Any,
) -> Callable[[ArgumentParser], ArgumentParser]: ...
def add_argument_group(
title: str | None = None,
description: str | None = None,
*,
prefix_chars: str = ...,
argument_default: Any = ...,
conflict_handler: str = ...,
) -> Callable[[ArgumentParser], ArgumentParser]: ...
def add_mutually_exclusive_group(
*,
required: bool = False
) -> Callable[[ArgumentParser], ArgumentParser]: ...
@overload
def add_subparsers(
*,
title: str = ...,
description: str | None = ...,
prog: str = ...,
action: type[Action] = ...,
option_string: str = ...,
dest: str | None = ...,
required: bool = ...,
help: str | None = ...,
metavar: str | None = ...,
) -> Callable[[ArgumentParser], ArgumentParser]: ...
@overload
def add_subparsers(
*,
title: str = ...,
description: str | None = ...,
prog: str = ...,
parser_class: type[_ArgumentParserT],
action: type[Action] = ...,
option_string: str = ...,
dest: str | None = ...,
required: bool = ...,
help: str | None = ...,
metavar: str | None = ...,
) -> Callable[[ArgumentParser], ArgumentParser]: ...
def add_parser(
parser,
name: str | None,
*,
help: str | None = ...,
aliases: Sequence[str] = ...,
prog: str | None = ...,
usage: str | None = ...,
description: str | None = ...,
epilog: str | None = ...,
parents: Sequence[_ArgumentParserT] = ...,
formatter_class: _FormatterClass = ...,
prefix_chars: str = ...,
fromfile_prefix_chars: str | None = ...,
argument_default: Any = ...,
conflict_handler: str = ...,
add_help: bool = ...,
allow_abbrev: bool = ...,
exit_on_error: bool = ...,
) -> Callable[[ArgumentParser], ArgumentParser]: ...