summaryrefslogtreecommitdiff
path: root/lib/pry/commands/show_input.rb
blob: bc44806fc87c83d6eb30a182e203d2f464e3abed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

class Pry
  class Command
    class ShowInput < Pry::ClassCommand
      match 'show-input'
      group 'Editing'
      description 'Show the contents of the input buffer for the current ' \
                  'multi-line expression.'

      banner <<-'BANNER'
        Show the contents of the input buffer for the current multi-line expression.
      BANNER

      def process
        output.puts Code.new(eval_string).with_line_numbers
      end
    end

    Pry::Commands.add_command(Pry::Command::ShowInput)
  end
end