diff --git a/cmd/mbf/main.go b/cmd/mbf/main.go index 1340d64..b7d6f61 100644 --- a/cmd/mbf/main.go +++ b/cmd/mbf/main.go @@ -195,6 +195,41 @@ func main() { ) } + c.NewCommand( + "report", + "Generate an artifact cure report for the current cache", + func(args []string) (err error) { + var w *os.File + switch len(args) { + case 0: + w = os.Stdout + + case 1: + if w, err = os.OpenFile( + args[0], + os.O_CREATE|os.O_EXCL|syscall.O_WRONLY, + 0, + ); err != nil { + return + } + defer func() { + closeErr := w.Close() + if err == nil { + err = closeErr + } + }() + + default: + return errors.New("report requires 1 argument") + } + + if container.Isatty(int(w.Fd())) { + return errors.New("output appears to be a terminal") + } + return rosa.WriteReport(msg, w, cache) + }, + ) + c.NewCommand("updates", command.UsageInternal, func([]string) error { var n int for i := range rosa.PresetEnd {