diff options
| author | Kevin Wallace <kevin@pentabarf.net> | 2026-02-27 02:24:55 -0800 |
|---|---|---|
| committer | Kevin Wallace <kevin@pentabarf.net> | 2026-02-27 02:30:13 -0800 |
| commit | 02160b61e8511bf807c18a930f1c599cfade8833 (patch) | |
| tree | f0e3cc7310346974d17fd3d93d97a49ab1b720a6 /cmd/ipp/main.go | |
| parent | initial commit (diff) | |
simplify
Diffstat (limited to 'cmd/ipp/main.go')
| -rw-r--r-- | cmd/ipp/main.go | 15 |
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 {} } } |