From f3b169dea3f2fef8738723eb1ce976df04ca2193 Mon Sep 17 00:00:00 2001 From: esotericpig Date: Sat, 26 Jun 2021 18:54:54 +0800 Subject: [PATCH] Fix refresh_cmd() to not copy the default_proc - For now. In the future, can set it back and find the places where the code is broken from it. --- lib/nhkore/app.rb | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/nhkore/app.rb b/lib/nhkore/app.rb index ba7bda2..a32119c 100644 --- a/lib/nhkore/app.rb +++ b/lib/nhkore/app.rb @@ -506,14 +506,20 @@ def refresh_cmd(opts,args,cmd) new_opts[key] = value end - # Cri has a default proc for default values - # that doesn't store the keys. - new_opts.default_proc = proc do |hash,key| - # :max_retry => %s(max-retry) - key = key.to_s.gsub('_','-').to_sym - - opts.default_proc.call(hash,key) - end + # For now don't set the default proc, as the original code + # did not have this in mind. + # Specifically, SiftCmd.build_sift_filename() is affected by + # this due to relying on @cmd_opts[:ext] to be nil. + # It's easy to change this one instance, but I'm not sure + # at the moment where else might be affected + ## Cri has a default proc for default values + ## that doesn't store the keys. + #new_opts.default_proc = proc do |hash,key| + # # :max_retry => %s(max-retry) + # key = key.to_s.gsub('_','-').to_sym + # + # opts.default_proc.call(hash,key) + #end @cmd = cmd @cmd_args = args