summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wallace <kevin@pentabarf.net>2026-02-27 02:24:55 -0800
committerKevin Wallace <kevin@pentabarf.net>2026-02-27 02:30:13 -0800
commit02160b61e8511bf807c18a930f1c599cfade8833 (patch)
treef0e3cc7310346974d17fd3d93d97a49ab1b720a6
parentinitial commit (diff)
simplify
-rw-r--r--autorun.sh2
-rw-r--r--cmd/ipp/main.go15
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 {}
}
}