Some incomplete initial code

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
This commit is contained in:
Dave Henderson
2018-08-01 23:46:37 -04:00
parent d45c09fb92
commit 926b9f6304
10 changed files with 542 additions and 0 deletions

26
cmd/image.go Normal file
View 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
},
}
}