Skip to content

Commit

Permalink
Remove fmt.go from lshid
Browse files Browse the repository at this point in the history
  • Loading branch information
sstallion committed Jun 7, 2023
1 parent f1a3ccb commit a8f47b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 43 deletions.
43 changes: 0 additions & 43 deletions cmd/lshid/fmt.go

This file was deleted.

16 changes: 16 additions & 0 deletions cmd/lshid/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"flag"
"fmt"
"os"
"strings"

"github.com/sstallion/go-hid"
"github.com/sstallion/go-tools/util"
Expand All @@ -49,6 +50,21 @@ var (
pidFlag uint
)

func fmtRelease(n uint16) string {
if n == 0 {
return "(empty)"
}
return fmt.Sprintf("%#04x (%x.%x)", n, n>>8, n&0xff)
}

func fmtString(s string) string {
s = strings.TrimSpace(s)
if s == "" {
return "(empty)"
}
return s
}

func usage() {
util.PrintGlobalUsage(`
Lshid lists HID devices attached to the system.
Expand Down

0 comments on commit a8f47b7

Please sign in to comment.