From 10a6739cb353fa54d24e9f8c8e5dd44a1007eeae Mon Sep 17 00:00:00 2001 From: Shannon Skipper Date: Sun, 24 Nov 2013 13:19:12 -0800 Subject: [PATCH] Add load path autocompletion for %cat command. --- lib/pry/commands/cat.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/pry/commands/cat.rb b/lib/pry/commands/cat.rb index a6f96267..f3b45514 100644 --- a/lib/pry/commands/cat.rb +++ b/lib/pry/commands/cat.rb @@ -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