Class: Byebug::ShowCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/byebug/commands/show.rb

Overview

Implements byebug “show” command.

Constant Summary collapse

Subcommands =
[
  ['args'          , 2 , 'Show argument list to the program being '     \
                         'debugged when it is started'                    ],
  ['autoeval'      , 4 , 'Show whether unrecognized commands are '      \
                         'evaluated'                                      ],
  ['autolist'      , 4 , 'Show whether "list" command is run on stopping' ],
  ['autoirb'       , 4 , 'Show whether IRB is invoked on stopping'        ],
  ['autoreload'    , 4 , 'Show whether source code is reloaded when '   \
                         'changed'                                        ],
  ['basename'      , 1 , 'Show whether basename is used when reporting' \
                         ' files'                                         ],
  ['callstyle'     , 2 , 'Show parameter style used when showing call'  \
                         ' frames'                                        ],
  ['commands'      , 2 , 'Show the history of commands you typed. You ' \
                         'can supply a command number to start with'      ],
  ['forcestep'     , 1 , 'Show whether "next/step" commands are set to' \
                         ' always move to a line'                         ],
  ['fullpath'      , 2 , 'Show whether full paths are displayed in frames'],
  ['history'       , 2 , 'Show command history configurations. '          ],
  ['linetrace'     , 3 , 'Show line execution tracing status'             ],
  ['linetrace_plus', 10, 'Show whether different consecutive lines are' \
                         ' shown in tracing'                              ],
  ['listsize'      , 3 , 'Show number of source lines to list by default' ],
  ['post_mortem'   , 3 , 'Show whether we should go into post-mortem '  \
                         'debugging on an uncaught exception'             ],
  ['stack_on_error', 1 , 'Show whether a stack trace is displayed when' \
                         ' "eval" raises an exception'                    ],
  ['verbose'       , 4 , 'Show whether verbose output for debugging '   \
                         'byebug itself is enabled'                       ],
  ['version'       , 1 , 'Show byebug\'s version'                         ],
  ['width'         , 1 , 'Show the number of characters per line for '  \
                         'byebug'                                         ]
].map do |name, min, help|
  Subcmd.new(name, min, help)
end
ShowHistorySubcommands =
[
  ['filename', 1, 'Show the filename in which to record command history' ],
  ['save'    , 1, 'Show whether history record should be saved on exit'  ],
  ['size'    , 1, 'Show the size of the command history'                 ]
].map do |name, min, help|
  Subcmd.new(name, min, help)
end

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

command_exists?, commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match, register_setting_get, register_setting_set, register_setting_var, settings, settings_map, terminal_width

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



218
219
220
# File 'lib/byebug/commands/show.rb', line 218

def description
  %{Generic command for showing things about byebug.}
end

.namesObject



214
215
216
# File 'lib/byebug/commands/show.rb', line 214

def names
  %w(show)
end

Instance Method Details

#executeObject



200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/byebug/commands/show.rb', line 200

def execute
  return print ShowCommand.help(nil) unless @match[1]

  args = @match[1].split(/[ \t]+/)
  param = args.shift
  subcmd = Command.find(Subcommands, param)
  if subcmd
    print "%s\n" % show_setting(subcmd.name)
  else
    print "Unknown show command #{param}\n"
  end
end

#regexpObject



196
197
198
# File 'lib/byebug/commands/show.rb', line 196

def regexp
  /^\s* show (?:\s+(.+))? \s*$/x
end