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:
parent
173bbd02da
commit
10a6739cb3
1 changed files with 8 additions and 1 deletions
|
@ -45,7 +45,14 @@ class Pry
|
||||||
end
|
end
|
||||||
|
|
||||||
def complete(search)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue