]> git.cworth.org Git - sup/commitdiff
add intro help text and 'e' command to console mode
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 18 Aug 2009 18:33:04 +0000 (14:33 -0400)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 18 Aug 2009 18:35:47 +0000 (14:35 -0400)
'e' restarts evaluation once you've stopped it with ctrl-g.

lib/sup/modes/console-mode.rb

index 372a4665a554663fbab105d17cb2223dd9b891a2..e2a69d9389b9da8fbeca40aa79aff22c5c00c4ba 100644 (file)
@@ -59,9 +59,20 @@ class Console
 end
 
 class ConsoleMode < LogMode
+  register_keymap do |k|
+    k.add :run, "Restart evaluation", 'e'
+  end
+
   def initialize
     super
-    @binding = Console.new(self).instance_eval { binding }
+    @console = Console.new self
+    @binding = @console.instance_eval { binding }
+    self << <<EOS
+Sup #{VERSION} console.
+Available commands: #{(@console.methods - Object.methods) * ", "}
+Ctrl-g stops evaluation; 'e' restarts it.
+
+EOS
   end
 
   def execute cmd