Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit b1b576e

Browse files
author
Jan Krems
committed
feat: Add help command
1 parent 360580e commit b1b576e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

lib/node-inspect.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,40 @@ function createCommandContext(inspector) {
513513
}
514514

515515
const ctx = {
516+
get help() {
517+
const commands = [
518+
[
519+
'run (r)',
520+
'cont (c)',
521+
'next (n)',
522+
'step (s)',
523+
'out (o)',
524+
'backtrace (bt)',
525+
'setBreakpoint (sb)',
526+
'clearBreakpoint (cb)',
527+
],
528+
[
529+
'watch',
530+
'unwatch',
531+
'watchers',
532+
'repl',
533+
'exec',
534+
'restart',
535+
'kill',
536+
'list',
537+
'scripts',
538+
'breakOnException',
539+
'breakpoints',
540+
'version',
541+
],
542+
];
543+
544+
const commandList = commands.map((group) => group.join(', ')).join(',\n');
545+
const helpMessage = `Commands: ${commandList}`;
546+
547+
print(helpMessage);
548+
},
549+
516550
debugEval(code) {
517551
// Repl asked for scope variables
518552
if (code === '.scope') {

0 commit comments

Comments
 (0)