aboutsummaryrefslogtreecommitdiff
path: root/forward-please
diff options
context:
space:
mode:
Diffstat (limited to 'forward-please')
-rwxr-xr-xforward-please17
1 files changed, 14 insertions, 3 deletions
diff --git a/forward-please b/forward-please
index dcd7f75..ebb6d4b 100755
--- a/forward-please
+++ b/forward-please
@@ -26,6 +26,16 @@ end
$instructions = []
def forward(frame, iface)
+ if !$clickframes.keys.include?(frame)
+ puts "#{frame} is not a frame in this click"
+ return
+ end
+
+ if !$level.interfaces.include?(iface)
+ puts "#{iface} is not an interface in this device"
+ return
+ end
+
$instructions << [frame, $clickframes[frame].to(iface)]
end
@@ -93,9 +103,7 @@ def click
end
def handle(cmd)
- case cmd[0]
- when ?h
- help
+ case cmd.split[0]
when ?f
args = cmd.split[1..]
if args.count == 2
@@ -111,6 +119,9 @@ def handle(cmd)
click
when ?q
exit 0
+ when nil
+ else
+ help
end
end