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

added file-mode toggle command, brings in filesystem completion and

changes the prompt
This commit is contained in:
John Mair 2011-04-07 05:38:18 +12:00
parent d057388d17
commit 2c54ab302f
3 changed files with 13 additions and 1 deletions

View file

@ -146,6 +146,17 @@ class Pry
end
end
command "file-mode", "Toggle file mode." do
case Pry.active_instance.prompt
when Pry::FILE_PROMPT
Pry.active_instance.prompt = Pry::DEFAULT_PROMPT
Pry.active_instance.custom_completions = Pry::DEFAULT_CUSTOM_COMPLETIONS
else
Pry.active_instance.prompt = Pry::FILE_PROMPT
Pry.active_instance.custom_completions = Pry::FILE_COMPLETIONS
end
end
command "nesting", "Show nesting information." do
nesting = opts[:nesting]

View file

@ -2,4 +2,5 @@ class Pry
# This proc will be instance_eval's against the active Pry instance
DEFAULT_CUSTOM_COMPLETIONS = proc { commands.commands.keys }
FILE_COMPLETIONS = proc { commands.commands.keys + Dir.entries('.') }
end

View file

@ -1,3 +1,3 @@
class Pry
VERSION = "0.7.7.2"
VERSION = "0.8.0pre1"
end