aboutsummaryrefslogtreecommitdiff
path: root/forward-please
diff options
context:
space:
mode:
authorNat Lasseter <user@4574.co.uk>2024-05-08 14:31:31 +0100
committerNat Lasseter <user@4574.co.uk>2024-05-08 14:31:31 +0100
commitff35b0bdce9f87b5b4603bd8acc94a7b2a363ffa (patch)
tree896ba12d0b2d281753cb6dd52c4217cc763c0afc /forward-please
parent08685d31b48b6a3c97ae329628d2e6531398a8bb (diff)
Fix i command
Diffstat (limited to 'forward-please')
-rwxr-xr-xforward-please24
1 files changed, 14 insertions, 10 deletions
diff --git a/forward-please b/forward-please
index 69f5dd1..dcd7f75 100755
--- a/forward-please
+++ b/forward-please
@@ -11,8 +11,6 @@ end
$level = $levels.shift
-puts $level.description
-
def help
puts <<~EOF
Commands:
@@ -20,7 +18,6 @@ def help
h: this help
c: click on
d: show the level description
- i: show the interfaces
a: show the click frames and actions
q: quit
EOF
@@ -34,15 +31,19 @@ end
def clickactions
puts "Click #{$click}:"
- puts "Frames:"
+
+ puts " Interfaces:"
+ puts " #{$level.interfaces.join(", ")}"
+
+ puts " Frames:"
$clickframes.each do |id, frame|
- puts " #{id}: #{frame.description} from Interface #{frame.iface}"
+ puts " #{id}: #{frame.description} from Interface #{frame.iface}"
end
i = 1
- puts "Actions:"
+ puts " Actions:"
$instructions.each do |instr|
- puts " #{i}: Forward frame #{instr[0]} to interface #{instr[1].iface}"
+ puts " #{i}: Forward frame #{instr[0]} to interface #{instr[1].iface}"
end
end
@@ -82,7 +83,9 @@ def click
puts "Demo all done"
exit 0
end
+ puts
puts $level.description
+ puts
end
$clickframes = $level.generate
@@ -102,8 +105,6 @@ def handle(cmd)
end
when ?d
puts $level.description
- when ?i
- puts $level.interfaces
when ?a
clickactions
when ?c
@@ -113,9 +114,12 @@ def handle(cmd)
end
end
-$clickframes = $level.generate
+puts $level.description
+puts
+$clickframes = $level.generate
clickactions
+
loop do
print ">: "
handle(gets.strip)