From b47e9b4df9e94009d59cc9e5b3e0dac5d8990962 Mon Sep 17 00:00:00 2001 From: Matthieu Prat Date: Fri, 10 Jan 2025 15:54:34 +0000 Subject: [PATCH] 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] #> 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. --- lib/debug/session.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/debug/session.rb b/lib/debug/session.rb index 05dc7f508..ff53610c1 100644 --- a/lib/debug/session.rb +++ b/lib/debug/session.rb @@ -931,7 +931,6 @@ def register_default_command register_command 'eval', 'call' do |arg| if arg == nil || arg.empty? show_help 'eval' - @ui.puts "\nTo evaluate the variable `#{cmd}`, use `pp #{cmd}` instead." :retry else request_eval :call, arg