Skip to content

Commit

Permalink
added file-mode toggle command, brings in filesystem completion and
Browse files Browse the repository at this point in the history
changes the prompt
  • Loading branch information
banister committed Apr 6, 2011
1 parent d057388 commit 2c54ab3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions lib/pry/commands.rb
Expand Up @@ -146,6 +146,17 @@ class Commands < CommandBase
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]

Expand Down
1 change: 1 addition & 0 deletions lib/pry/custom_completions.rb
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lib/pry/version.rb
@@ -1,3 +1,3 @@
class Pry
VERSION = "0.7.7.2"
VERSION = "0.8.0pre1"
end

0 comments on commit 2c54ab3

Please sign in to comment.