lib/byebug/commands/show.rb in byebug-1.3.0 vs lib/byebug/commands/show.rb in byebug-1.3.1
- old
+ new
@@ -196,35 +196,22 @@
def regexp
/^show (?: \s+ (.+) )?$/xi
end
def execute
- if not @match[1]
- print format_subcmds(Subcommands)
+ return print ShowCommand.help(nil) unless @match[1]
+
+ args = @match[1].split(/[ \t]+/)
+ param = args.shift
+ subcmd = find(Subcommands, param)
+ if subcmd
+ print "%s\n" % show_setting(subcmd.name)
else
- args = @match[1].split(/[ \t]+/)
- param = args.shift
- subcmd = find(Subcommands, param)
- if subcmd
- print "%s\n" % show_setting(subcmd.name)
- else
- print "Unknown show command #{param}\n"
- end
+ print "Unknown show command #{param}\n"
end
end
- def help(args)
- if args[1]
- subcmd = find(Subcommands, args[1])
- return "Invalid \"show\" subcommand \"#{args[1]}\"." unless subcmd
- str = subcmd.short_help + '.'
- str += "\n" + subcmd.long_help if subcmd.long_help
- return str
- end
- ShowCommad.description + format_subcmds(Subcommands)
- end
-
class << self
def names
%w(show)
end
@@ -232,7 +219,8 @@
%{
Generic command for showing things about byebug.
}
end
end
+
end
end