Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor devices, add cover size stuff #1

Merged
merged 15 commits into from
Nov 25, 2019
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/geek1011/koboutils

go 1.12
go 1.13

require github.com/spf13/pflag v1.0.3
8 changes: 5 additions & 3 deletions kobo-info/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ func main() {
}

if device, ok := kobo.DeviceByID(id); ok {
printkv("Device", device.Name)
printkv("Device", device.Name())
printkv("Device ID", id)
printkv("Hardware", device.Hardware)
printkv("Device Family", fmt.Sprintf("%s (%s)", device.Family(), device.CodeNames().Family()))
printkv("Codenames", device.CodeNames().String())
printkv("Hardware", device.Hardware().String())
} else {
printkv("Device", "unknown")
printkv("Device ID", id)
Expand Down Expand Up @@ -96,7 +98,7 @@ func printkv(key, value string) {
}
fmt.Printf(` "%s": "%s"`, strings.Replace(strings.ToLower(key), " ", "_", -1), value)
} else {
fmt.Printf("%10s: %s\n", key, value)
fmt.Printf("%15s: %s\n", key, value)
}
}

Expand Down
Loading