Sha256: 2552f450fc69dc27bc0acb566f51df0bf1e398dafdb82c4a353cb9c971c1928a

Contents?: true

Size: 857 Bytes

Versions: 21

Compression:

Stored size: 857 Bytes

Contents

module Debugger

  # Implements debugger "quit" command
  class QuitCommand < Command
    self.allow_in_control = true

    def regexp
      / ^\s*
         (?:q(?:uit)?|exit) \s*
         (!|\s+unconditionally)? \s*
         $
      /ix
    end

    def execute
      if @match[1] or confirm("Really quit? (y/n) ") 
        @state.interface.finalize
        exit! # exit -> exit!: No graceful way to stop threads...
      end
    end

    class << self
      def help_command
        %w[quit exit]
      end

      def help(cmd)
        %{
          q[uit] [!|unconditionally]\texit from debugger. 
          exit[!]\talias to quit

          Normally we prompt before exiting. However if the parameter
          "unconditionally" or is given or suffixed with !, we stop
          without asking further questions.  
         }
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
debugger2-1.0.0.beta2 lib/ruby-debug/commands/quit.rb
debugger2-1.0.0.beta1 lib/ruby-debug/commands/quit.rb
debugger-1.4.0 lib/ruby-debug/commands/quit.rb
debugger-1.3.3 lib/ruby-debug/commands/quit.rb
debugger-1.3.2 lib/ruby-debug/commands/quit.rb
debugger-1.3.1 lib/ruby-debug/commands/quit.rb
debugger-1.3.0 lib/ruby-debug/commands/quit.rb
debugger-1.2.4 lib/ruby-debug/commands/quit.rb
debugger-1.2.3 lib/ruby-debug/commands/quit.rb
debugger-1.2.2 lib/ruby-debug/commands/quit.rb
debugger-1.2.1 lib/ruby-debug/commands/quit.rb
debugger-1.2.0 lib/ruby-debug/commands/quit.rb
debugger-1.1.4 lib/ruby-debug/commands/quit.rb
debugger-1.1.3 lib/ruby-debug/commands/quit.rb
debugger-1.1.2 lib/ruby-debug/commands/quit.rb
debugger-1.1.1 lib/ruby-debug/commands/quit.rb
debugger-1.1.0 lib/ruby-debug/commands/quit.rb
debugger-1.0.1 lib/ruby-debug/commands/quit.rb
debugger-1.0.0 cli/ruby-debug/commands/quit.rb
debugger-1.0.0.rc2 cli/ruby-debug/commands/quit.rb