lib/byebug/commands/show.rb in byebug-3.5.1 vs lib/byebug/commands/show.rb in byebug-4.0.0
- old
+ new
@@ -1,5 +1,7 @@
+require 'byebug/command'
+
module Byebug
#
# Show byebug settings.
#
class ShowCommand < Command
@@ -11,33 +13,31 @@
def execute
key = @match[:setting]
return puts(self.class.help) if key.nil?
- full_key = Setting.find(key)
- return errmsg("Unknown setting :#{key}") unless full_key
+ setting = Setting.find(key)
+ return errmsg(pr('show.errors.unknown_setting', key: key)) unless setting
- puts Setting.settings[full_key.to_sym].to_s
+ puts Setting.settings[setting.to_sym]
end
class << self
def names
%w(show)
end
def description
- <<-EOD.gsub(/^ {8}/, '')
-
+ prettify <<-EOD
show <setting> <value>
Generic command for showing byebug settings. You can change them with
the "set" command.
-
EOD
end
- def help(subcmds = [])
- Setting.help('show', subcmds.first)
+ def help(subcmd = nil)
+ Setting.help('show', subcmd)
end
end
end
end