Sha256: 29ba114f97c951233295657af4ef93c809af12b129c08f9393a9630f23a4226d

Contents?: true

Size: 831 Bytes

Versions: 8

Compression:

Stored size: 831 Bytes

Contents

require 'byebug/command'

module Byebug
  #
  # Exit from byebug.
  #
  class QuitCommand < Command
    self.allow_in_control = true

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

    def execute
      return unless @match[1] || confirm(pr('quit.confirmations.really'))

      @state.interface.autosave
      @state.interface.close
      exit! # exit -> exit!: No graceful way to stop...
    end

    class << self
      def names
        %w(quit)
      end

      def description
        prettify <<-EOD
          q[uit] [!|unconditionally] Exits from byebug.

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

Version data entries

8 entries across 7 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/byebug-4.0.5/lib/byebug/commands/quit.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/byebug-4.0.5/lib/byebug/commands/quit.rb
byebug-4.0.5 lib/byebug/commands/quit.rb
byebug-4.0.4 lib/byebug/commands/quit.rb
byebug-4.0.3 lib/byebug/commands/quit.rb
byebug-4.0.2 lib/byebug/commands/quit.rb
byebug-4.0.1 lib/byebug/commands/quit.rb
byebug-4.0.0 lib/byebug/commands/quit.rb