From cb71a7dab3043ecf7016caec2de234624e10360c Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 13 Jan 2011 11:13:57 -0800 Subject: [PATCH] debugger: take help message from commands --- lib/_debugger.js | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/lib/_debugger.js b/lib/_debugger.js index 6392b88..554cdaa 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -307,10 +307,25 @@ Client.prototype.step = function(action, count, cb) { }; +var commands = [ + 'backtrace', + 'continue', + 'help', + 'info breakpoints', + 'kill', + 'list', + 'next', + 'print', + 'quit', + 'run', + 'scripts', + 'step', + 'version', +]; -var helpMessage = 'Commands: run, kill, print, step, next, ' + - 'continue, list, scripts, backtrace, version, quit'; +var helpMessage = 'Commands: ' + commands.join(', '); + function SourceUnderline(sourceText, position) { if (!sourceText) return; @@ -402,23 +417,6 @@ function Interface() { } -var commands = [ - 'backtrace', - 'continue', - 'help', - 'info breakpoints', - 'kill', - 'list', - 'next', - 'print', - 'quit', - 'run', - 'scripts', - 'step', - 'version', -]; - - Interface.prototype.complete = function(line) { // Match me with a command. var matches = []; -- 2.7.4