module Pry::InputCompleter

We kill the built in completion so we can tell users what things are available

Public Class Methods

build_completion_proc(target, commands=[""], cmplns = nil) click to toggle source
# File lib/collins_shell/console.rb, line 11
def build_completion_proc(target, commands=[""], cmplns = nil)
  if cmplns.is_a?(Array) then # Work around for breakage between pry 0.9.9.6 and 0.9.12
    commands = cmplns
  end
  proc do |input|
    commands.map do |cmd|
      cmd_s = cmd.to_s
      if cmd_s.include?(":wtf") then
        "wtf?"
      else
        cmd_s
      end
    end.select{|s| s.start_with?(input)}.uniq # commands.map
  end # proc do
end