| 14 | |
| 15 | |
| 16 | class TAddon: |
| 17 | @command.command("cmd1") |
| 18 | def cmd1(self, foo: str) -> str: |
| 19 | """cmd1 help""" |
| 20 | return "ret " + foo |
| 21 | |
| 22 | @command.command("cmd2") |
| 23 | def cmd2(self, foo: str) -> str: |
| 24 | return 99 |
| 25 | |
| 26 | @command.command("cmd3") |
| 27 | def cmd3(self, foo: int) -> int: |
| 28 | return foo |
| 29 | |
| 30 | @command.command("cmd4") |
| 31 | def cmd4(self, a: int, b: str, c: mitmproxy.types.Path) -> str: |
| 32 | return "ok" |
| 33 | |
| 34 | @command.command("subcommand") |
| 35 | def subcommand( |
| 36 | self, cmd: mitmproxy.types.Cmd, *args: mitmproxy.types.CmdArgs |
| 37 | ) -> str: |
| 38 | return "ok" |
| 39 | |
| 40 | @command.command("empty") |
| 41 | def empty(self) -> None: |
| 42 | pass |
| 43 | |
| 44 | @command.command("varargs") |
| 45 | def varargs(self, one: str, *var: str) -> Sequence[str]: |
| 46 | return list(var) |
| 47 | |
| 48 | def choices(self) -> Sequence[str]: |
| 49 | return ["one", "two", "three"] |
| 50 | |
| 51 | @command.argument("arg", type=mitmproxy.types.Choice("choices")) |
| 52 | def choose(self, arg: str) -> Sequence[str]: |
| 53 | return ["one", "two", "three"] |
| 54 | |
| 55 | @command.command("path") |
| 56 | def path(self, arg: mitmproxy.types.Path) -> None: |
| 57 | pass |
| 58 | |
| 59 | @command.command("flow") |
| 60 | def flow(self, f: Flow, s: str) -> None: |
| 61 | pass |
| 62 | |
| 63 | |
| 64 | class Unsupported: |
no outgoing calls
searching dependent graphs…