From 83a3d1e15ea162053a646015313182a2b3edc860 Mon Sep 17 00:00:00 2001 From: st0012 Date: Mon, 4 Jul 2022 12:44:36 +0100 Subject: [PATCH 1/2] Remore mode from the configuration hash mode is not an actual configuration option, it's only used to carry the result of parse_argv to exe/rdbg's case statement. Having it in the config hash will cause confusion and make `CONFIG.set_config(config)` fail. --- exe/rdbg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exe/rdbg b/exe/rdbg index af8280633..0507d139b 100755 --- a/exe/rdbg +++ b/exe/rdbg @@ -3,7 +3,9 @@ require_relative '../lib/debug/config' config = DEBUGGER__::Config::parse_argv(ARGV) -case config[:mode] +# mode is not an actual configuration option +# it's only used to carry the result of parse_argv here +case config.delete(:mode) when :start require 'rbconfig' From 021a1ea2c13005c08a4265672af7f4fd309da147 Mon Sep 17 00:00:00 2001 From: st0012 Date: Mon, 4 Jul 2022 12:46:45 +0100 Subject: [PATCH 2/2] Use CONFIG.set_config instead of CONFIG.update `update` replaces the hash directly and can drop the populated default values, while `set_config` keeps the value `CONFIG` already has and only sets the differences. --- exe/rdbg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exe/rdbg b/exe/rdbg index 0507d139b..1cddfd1f2 100755 --- a/exe/rdbg +++ b/exe/rdbg @@ -20,7 +20,7 @@ when :start when :attach require_relative "../lib/debug/client" - ::DEBUGGER__::CONFIG.update config + ::DEBUGGER__::CONFIG.set_config **config begin if ARGV.empty? && config[:port]