ms-tools/cli/raw.go
2022-11-20 18:19:34 +01:00

25 lines
423 B
Go

package main
import (
"encoding/hex"
"fmt"
)
type RawCmd struct {
Data string `arg name:"value" help:"Value to write."`
}
func (w RawCmd) Run(c *Context) error {
buf, err := hex.DecodeString(w.Data)
if err != nil {
return err
}
out, err := c.hal.ROMExchangeReport(buf)
if err != nil {
return err
}
fmt.Println("Raw command results:", hex.EncodeToString(buf), "->", hex.EncodeToString(out))
return nil
}