Skip to content

Commit

Permalink
Fix refresh_cmd() to not copy the default_proc
Browse files Browse the repository at this point in the history
- For now. In the future, can set it back and find
  the places where the code is broken from it.
  • Loading branch information
esotericpig committed Jun 26, 2021
1 parent 6675957 commit f3b169d
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions lib/nhkore/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f3b169d

Please sign in to comment.