Class: Byebug::SetCommand
Overview
Implements byebug “set” command.
Defined Under Namespace
Classes: Subcmd2
Constant Summary collapse
- Subcommands =
[ ['args' , 2 , false, 'Set argument list to the program ' \ 'being debugged when it is started' ], ['autoeval' , 5 , true , 'Evaluate every unrecognized command' ], ['autolist' , 5 , true , 'Execute "list" command on every ' \ 'breakpoint' ], ['autoirb' , 5 , true , 'Invoke IRB on every stop' ], ['autoreload' , 5 , true , 'Reload source code when changed' ], ['autosave' , 5 , true , 'Automatically save command history ' \ 'record on exit' ], ['basename' , 1 , true , 'Set filename display style' ], ['callstyle' , 2 , false, 'Set how you want call parameters ' \ 'displayed' ], ['forcestep' , 2 , true , 'Make sure "next/step" commands always' \ 'move to a new line' ], ['fullpath' , 2 , true , 'Display full file names in frames' ], ['histfile' , 5 , false, 'Customize file where history is ' \ 'loaded from and saved to. By ' \ 'default, .byebug_hist' ], ['histsize' , 5 , false, 'Customize maximum number of commands ' \ 'that are stored in byebug history ' \ 'record. By default, 256' ], ['linetrace' , 3 , true , 'Enable line execution tracing' ], ['linetrace_plus', 10, true , 'Set line execution tracing to show' \ 'different lines' ], ['listsize' , 3 , false, 'Set number of source lines to list by' \ 'default' ], ['post_mortem' , 2 , true , 'Enable post-mortem mode' ], ['stack_on_error', 1 , true , 'Display stack trace when "eval" ' \ 'raises exception' ], ['testing' , 2 , false, 'Used when testing byebug' ], ['verbose' , 1 , true , 'Enable verbose output of TracePoint ' \ 'API events is enabled' ], ['width' , 1 , false, 'Number of characters per line for ' \ 'byebug\'s output' ] ].map do |name, min, is_bool, help| Subcmd2.new(name, min, is_bool, 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
.description ⇒ Object
137 138 139 140 |
# File 'lib/byebug/commands/set.rb', line 137 def description %{Modifies parts of byebug environment. Boolean values take on, off, 1 or 0. You can see these environment settings with the "show" command.} end |
.names ⇒ Object
133 134 135 |
# File 'lib/byebug/commands/set.rb', line 133 def names %w(set) end |
Instance Method Details
#execute ⇒ Object
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/byebug/commands/set.rb', line 105 def execute return print SetCommand.help(nil) if SetCommand.names.include?(@match[0]) args = @match[1].split(/[ \t]+/) try_subcmd = args.shift try_subcmd.downcase! if try_subcmd =~ /^no/i set_on = false try_subcmd = try_subcmd[2..-1] else set_on = true end subcmd = Command.find(Subcommands, try_subcmd) return print "Unknown set command \"#{try_subcmd}\"\n" unless subcmd begin set_on = get_onoff(args[0]) if subcmd.is_bool and args.size > 0 rescue RuntimeError return end set_setting(subcmd.name, set_on, args) return print "#{show_setting(subcmd.name)}\n" end |
#regexp ⇒ Object
101 102 103 |
# File 'lib/byebug/commands/set.rb', line 101 def regexp /^\s* set (?:\s+(.*))? \s*$/x end |