Class Debugger::QuitCommand
In: cli/ruby-debug/commands/quit.rb
Parent: Command

Implements debugger "quit" command

Methods

execute   help   help_command   regexp  

Public Class methods

Returns a String given the help description of this command

[Source]

    # File cli/ruby-debug/commands/quit.rb, line 32
32:       def help(cmd)
33:         %{
34:           q[uit] [!|unconditionally]\texit from debugger. 
35:           exit[!]\talias to quit
36: 
37:           Normally we prompt before exiting. However if the parameter
38:           "unconditionally" or is given or suffixed with !, we stop
39:           without asking further questions.  
40:          }
41:      end

The command name listed via ‘help

[Source]

    # File cli/ruby-debug/commands/quit.rb, line 27
27:       def help_command
28:         %w[quit exit]
29:       end

Public Instance methods

The code that implements this command.

[Source]

    # File cli/ruby-debug/commands/quit.rb, line 18
18:     def execute
19:       if @match[1] or confirm("Really quit? (y/n) ") 
20:         @state.interface.finalize
21:         exit! # exit -> exit!: No graceful way to stop threads...
22:       end
23:     end

An input line is matched against this regular expression. If we have a match, run this command.

[Source]

    # File cli/ruby-debug/commands/quit.rb, line 9
 9:     def regexp
10:       / ^\s*
11:          (?:q(?:uit)?|exit) \s*
12:          (!|\s+unconditionally)? \s*
13:          $
14:       /ix
15:     end

[Validate]