1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Add load path autocompletion for %cat command.

This commit is contained in:
Shannon Skipper 2013-11-24 13:19:12 -08:00
parent 173bbd02da
commit 10a6739cb3

View file

@ -45,7 +45,14 @@ class Pry
end
def complete(search)
super + Bond::Rc.files(search.split(" ").last || '')
search_term = search.split.last || ''
super +
Bond::Rc.files(search_term) +
$LOAD_PATH.flat_map do |path|
Bond::Rc.files(File.join(path.dup, search_term)).map do |file_path|
File.basename(file_path)
end
end
end
end