module Byebug::CommandFunctions
def find(subcmds, param)
-
is
() -- downcased and can be abbreviated to the minimum length listed in
def find(subcmds, param) param.downcase! for try_subcmd in subcmds do if (param.size >= try_subcmd.min) and (try_subcmd.name[0..param.size-1] == param) return try_subcmd end end return nil end
def format_subcmds(subcmds)
Build formatted list of subcmds
#
def format_subcmds(subcmds) cmd_name = self.class.names.join("|") s = "\n" \ "--\n" \ "List of \"#{cmd_name}\" subcommands:\n" \ "--\n" for subcmd in subcmds do s += "#{cmd_name} #{subcmd.name} -- #{subcmd.short_help}\n" end return s end
def pad_with_dots(string)
Pad a string with dots at the end to fit :width setting
#
def pad_with_dots(string) if string.size > Command.settings[:width] string[Command.settings[:width]-3 .. -1] = "..." end end