Support shell-like command

This commit is contained in:
AkiraXie
2021-02-01 22:28:48 +08:00
parent 68945d2f20
commit f8fb36a1f7
3 changed files with 132 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import re
from argparse import ArgumentParser
from types import ModuleType
from contextvars import ContextVar
from typing import Any, Set, List, Dict, Type, Tuple, Union, Optional
@ -146,6 +147,15 @@ def on_command(cmd: Union[str, Tuple[str, ...]],
...
def on_shell_like_command(cmd: Union[str, Tuple[str, ...]],
rule: Optional[Union[Rule, T_RuleChecker]] = None,
aliases: Optional[Set[Union[str,
Tuple[str, ...]]]] = None,
shell_like_argsparser: Optional[ArgumentParser] = None,
**kwargs) -> Type[Matcher]:
...
def on_regex(pattern: str,
flags: Union[int, re.RegexFlag] = 0,
rule: Optional[Rule] = ...,