summaryrefslogtreecommitdiff
path: root/cmd
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 /cmd
parentinitial commit (diff)
simplify
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ipp/main.go15
1 files changed, 5 insertions, 10 deletions
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 {}
}
}