From 02160b61e8511bf807c18a930f1c599cfade8833 Mon Sep 17 00:00:00 2001 From: Kevin Wallace Date: Fri, 27 Feb 2026 02:24:55 -0800 Subject: simplify --- autorun.sh | 2 +- cmd/ipp/main.go | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/autorun.sh b/autorun.sh index 21e4a46..5a870d9 100644 --- a/autorun.sh +++ b/autorun.sh @@ -1,3 +1,3 @@ #!/bin/bash -x cd "$(dirname "$0")" -exec ./bin/ipp -f +exec ./bin/ipp diff --git a/cmd/ipp/main.go b/cmd/ipp/main.go index 85207a8..16317e0 100644 --- a/cmd/ipp/main.go +++ b/cmd/ipp/main.go @@ -28,9 +28,6 @@ func main() { panic(err) } defer cv.Close() - if flag.NArg() == 0 { - select {} - } for i := 0; i < flag.NArg(); i += 2 { var msgType byte var msgData []byte @@ -39,12 +36,10 @@ func main() { } else { msgType = byte(n) } - if flag.NArg() >= i { - if bs, err := hex.DecodeString(flag.Arg(i + 1)); err != nil { - panic(err) - } else { - msgData = bs - } + if bs, err := hex.DecodeString(flag.Arg(i + 1)); err != nil { + panic(err) + } else { + msgData = bs } if err := cv.SendIPP(msgType, msgData); err != nil { panic(err) @@ -56,7 +51,7 @@ func main() { } } } - if *follow { + if *follow || flag.NArg() == 0 { select {} } } -- cgit v1.2.3