tvx/extract: print confirmation.

This commit is contained in:
Raúl Kripalani 2020-09-27 20:30:32 +01:00
parent e5c56da321
commit a712c109d8

View File

@ -48,7 +48,7 @@ var extractCmd = &cli.Command{
&cli.StringFlag{ &cli.StringFlag{
Name: "id", Name: "id",
Usage: "identifier to name this test vector with", Usage: "identifier to name this test vector with",
Value: "<undefined>", Value: "(undefined)",
Destination: &extractFlags.id, Destination: &extractFlags.id,
}, },
&cli.StringFlag{ &cli.StringFlag{
@ -297,12 +297,13 @@ func runExtract(_ *cli.Context) error {
} }
output := io.WriteCloser(os.Stdout) output := io.WriteCloser(os.Stdout)
if extractFlags.file != "" { if file := extractFlags.file; file != "" {
output, err = os.Create(extractFlags.file) output, err = os.Create(file)
if err != nil { if err != nil {
return err return err
} }
defer output.Close() defer output.Close()
defer log.Printf("wrote test vector to file: %s", file)
} }
enc := json.NewEncoder(output) enc := json.NewEncoder(output)