Sha256: c1ba82819201238dadf4d3e494d26b998c1cc4d5be386e04ebab429cd2e7924c

Contents?: true

Size: 665 Bytes

Versions: 8

Compression:

Stored size: 665 Bytes

Contents

require 'byebug/command'

module Byebug
  #
  # Show history of byebug commands.
  #
  class HistoryCommand < Command
    def regexp
      /^\s* hist(?:ory)? (?:\s+(?<num_cmds>.+))? \s*$/x
    end

    def execute
      history = @state.interface.history

      if @match[:num_cmds]
        size, _ = get_int(@match[:num_cmds], 'history', 1, history.size)
        return errmsg(err) unless size
      end

      puts history.to_s(size)
    end

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

      def description
        prettify <<-EOD
          hist[ory] [num_cmds]        Show byebug's command history.
        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/history.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/byebug-4.0.5/lib/byebug/commands/history.rb
byebug-4.0.5 lib/byebug/commands/history.rb
byebug-4.0.4 lib/byebug/commands/history.rb
byebug-4.0.3 lib/byebug/commands/history.rb
byebug-4.0.2 lib/byebug/commands/history.rb
byebug-4.0.1 lib/byebug/commands/history.rb
byebug-4.0.0 lib/byebug/commands/history.rb