added some handy default commands

This commit is contained in:
Dominik Moritz Roth 2020-07-26 22:56:49 +02:00
parent 2e5a553736
commit efa1403380
2 changed files with 11 additions and 4 deletions

13
Rex.py
View File

@ -70,8 +70,6 @@ import pprint
async def test():
print("pokemon go")
async def close():
exit()
async def nA():
print("this is a test")
async def nB():
@ -88,11 +86,20 @@ async def question():
await rex.ask("What is your question? ")
class stdCmds:
async def close():
exit()
async def debug():
from ptpdb import set_trace
set_trace()
# This is an example (the default) cmd-dict
defaultCmds = {
"exit": stdCmds.close,
"debug": stdCmds.debug,
"test": test,
"exit": close,
"arg": arg,
"arg2": arg2,
"arg4": arg4,

View File

@ -1,4 +1,4 @@
- Syntax information in toolbar (configurable)
- Allow other delimiters (e.g. ".")
- Support named arguments
- Include often used commands in a defaults collection (e.g. close)
- Include more often used commands in a defaults collection (e.g. close)