-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnested.py
34 lines (29 loc) · 843 Bytes
/
nested.py
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
from eggella import Eggella
from eggella.command import RawCommandHandler
app = Eggella(__name__)
@app.on_command(
"config",
cmd_handler=RawCommandHandler(),
nested_completions={
"proxy": {
"socks": {"socks5://", "socks4://"},
"http": {"https://", "http://"},
},
"timeout": {"0", "30", "60"},
"render": {"spam", "egg", "foobar"},
},
nested_meta={
"proxy": "set proxy",
"socks": "usage SOCKS4/5 protocol",
"http": "usage http(s) protocol",
"timeout": "set request timeout",
"render": "render a string object",
"spam": "spammmm object",
"egg": "wow! eggs!",
"foobar": "rly? :O",
},
)
def config(query: str):
app.cmd.print_ft(f"Your answer: {query}")
if __name__ == '__main__':
app.loop()