Skip to content

Commit c434896

Browse files
author
Teis Johansen
committed
[click-shell] Add stubs for click-shell
This adds stubs for version 2.1 of the click-shell package: https://github.com/clarkperkins/click-shell
1 parent 85a787b commit c434896

File tree

6 files changed

+86
-0
lines changed

6 files changed

+86
-0
lines changed

stubs/click-shell/METADATA.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version = "2.1"
2+
requires = ["click>=8.0.0"]
3+
upstream_repository = "https://github.com/clarkperkins/click-shell"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from .core import Shell, make_click_shell
2+
from .decorators import shell
3+
4+
__all__ = ["make_click_shell", "shell", "Shell", "__version__"]
5+
__version__ = ...
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from cmd import Cmd
2+
from typing import Any
3+
4+
import click
5+
6+
class ClickCmd(Cmd):
7+
identchars = ...
8+
nohelp = ...
9+
nocommand = ...
10+
def __init__(
11+
self,
12+
ctx: click.Context | None = None,
13+
hist_file: str | None = None,
14+
*args: Any,
15+
**kwargs: Any,
16+
) -> None: ...
17+
def preloop(self) -> None: ...
18+
def postloop(self) -> None: ...
19+
def cmdloop(self, intro: str | None = None) -> None: ...
20+
def get_prompt(self) -> str | None: ...
21+
def emptyline(self) -> bool: ...
22+
def default(self, line: str) -> None: ...
23+
def get_names(self) -> list[str]: ...
24+
def do_help(self, arg: str) -> None: ...
25+
def do_quit(self, arg: str) -> bool: ...
26+
def do_exit(self, arg: str) -> bool: ...
27+
def print_topics(
28+
self, header: Any, cmds: list[str] | None, cmdlen: int, maxcol: int
29+
) -> None: ...
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import click
2+
3+
def get_choices(
4+
cli: click.Command, prog_name: str, args: list[str], incomplete: str
5+
) -> list[str]: ...
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
from logging import Logger
2+
from typing import Any, Callable
3+
4+
import click
5+
6+
from ._cmd import ClickCmd
7+
8+
logger: Logger
9+
10+
def get_invoke(command: click.Command) -> Callable[[ClickCmd, str], bool]: ...
11+
def get_help(command: click.Command) -> Callable[[ClickCmd], None]: ...
12+
def get_complete(
13+
command: click.Command,
14+
) -> Callable[[ClickCmd, str, str, int, int], list[str]]: ...
15+
16+
class ClickShell(ClickCmd):
17+
def add_command(self, cmd: click.Command, name: str) -> None: ...
18+
19+
def make_click_shell(
20+
ctx: click.Context,
21+
prompt: str | Callable[[], str] | Callable[[click.Context, str], str] | None = None,
22+
intro: str | None = None,
23+
hist_file: str | None = None,
24+
) -> ClickShell: ...
25+
26+
class Shell(click.Group):
27+
def __init__(
28+
self,
29+
prompt: str
30+
| Callable[[], str]
31+
| Callable[[click.Context, str], str]
32+
| None = None,
33+
intro: str | None = None,
34+
hist_file: str | None = None,
35+
on_finished: Callable[[click.Context], None] | None = None,
36+
**attrs: Any,
37+
) -> None: ...
38+
def add_command(self, cmd: click.Command, name: str | None = None) -> None: ...
39+
def invoke(self, ctx: click.Context) -> Any: ...
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from typing import Any, Callable
2+
3+
from .core import Shell
4+
5+
def shell(name: str | None = None, **attrs: Any) -> Callable[[Any], Shell]: ...

0 commit comments

Comments
 (0)