mirror of
https://github.com/hairyhenderson/go-onerng.git
synced 2025-07-07 19:05:08 -05:00
Some incomplete initial code
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
This commit is contained in:
26
cmd/image.go
Normal file
26
cmd/image.go
Normal file
@ -0,0 +1,26 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/hairyhenderson/go-onerng"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// imageCmd represents the image command
|
||||
func imageCmd(ctx context.Context) *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "image",
|
||||
Short: "Dump the OneRNG's firmware image",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
o := onerng.OneRNG{Path: opts.Device}
|
||||
image, err := o.Image(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Printf("%q\n", image)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user