diff options
author | Nat Lasseter <user@4574.co.uk> | 2024-05-08 14:56:35 +0100 |
---|---|---|
committer | Nat Lasseter <user@4574.co.uk> | 2024-05-08 14:56:35 +0100 |
commit | a24f29c0e92a70415f679bc8e2fdd4e6410e1948 (patch) | |
tree | eb86b870e1d87c264c28097575337954e0411c2b | |
parent | 053cb3d9b6f38269c5c0b769c204c873e3901bd7 (diff) |
Better ui
-rwxr-xr-x | forward-please | 17 |
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 |