Skip to content

Commit c213c20

Browse files
committed
feat(pmdb): add help command to print help message
1 parent 1981df5 commit c213c20

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

python/pythonmonkey/lib/pmdb.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,27 @@ def enable(debuggerGlobalObject = pm.eval("debuggerGlobal")):
9696
// Force exit the program
9797
mainGlobal.python.exit(127)
9898
break blockingLoop;
99+
case "h":
100+
case "help":
101+
// Print help message
102+
// XXX: keep this in sync with the actual implementation
103+
print([
104+
"List of commands:",
105+
"• c/cont: Continue execution until next breakpoint or debugger statement",
106+
"• n/next: Step next",
107+
"• bt/backtrace: Print backtrace of current execution frame",
108+
"• l/line: Print current line",
109+
"• p <expr>/print <expr>/exec <expr>: Execute an expression in debugging script's context and print its value",
110+
"• q/quit/kill: Force exit the program",
111+
"• h/help: Print help message",
112+
].join("\\n"))
113+
continue blockingLoop;
99114
case "":
100115
case undefined:
101116
// no-op
102117
continue blockingLoop;
103118
default:
104-
print(`Undefined command: "${command}"`)
119+
print(`Undefined command: "${command}". Try "help".`)
105120
}
106121
}
107122
}

0 commit comments

Comments
 (0)