Skip to content

Commit 32f55ff

Browse files
matthieupratko1
authored andcommitted
Fix help message of the eval command
When running the `eval` command (or its alias, `call`) without an argument, you get the following error: ``` [REPL ERROR] #<NameError: undefined local variable or method `cmd' for #<DEBUGGER__::Session:0x0000000120a0fa20>> debug-1.10.0/lib/debug/session.rb:934:in `block in register_default_command' debug-1.10.0/lib/debug/session.rb:1165:in `process_command' ... ``` ...instead of this hint: ``` To evaluate the variable `eval`, use `pp eval` instead. ``` I believe the regression was introduced in a402e73. To fix this issue, I was thinking of passing the command name alongside the argument in the `process_line` method but I wasn't sure this was worth it just for this hint. So I removed the hint altogether instead.
1 parent b0ca87e commit 32f55ff

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

lib/debug/session.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,6 @@ def register_default_command
931931
register_command 'eval', 'call' do |arg|
932932
if arg == nil || arg.empty?
933933
show_help 'eval'
934-
@ui.puts "\nTo evaluate the variable `#{cmd}`, use `pp #{cmd}` instead."
935934
:retry
936935
else
937936
request_eval :call, arg

0 commit comments

Comments
 (0)