cmd/mbf: integrate pkgserver into command info

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-02 05:05:56 +09:00
parent 09e23b8822
commit a0c1641e2f
17 changed files with 69 additions and 104 deletions

View File

@@ -17,25 +17,12 @@ func commandInfo(
args []string,
w io.Writer,
writeStatus bool,
reportPath string,
r *rosa.Report,
) (err error) {
if len(args) == 0 {
return errors.New("info requires at least 1 argument")
}
var r *rosa.Report
if reportPath != "" {
if r, err = rosa.OpenReport(reportPath); err != nil {
return err
}
defer func() {
if closeErr := r.Close(); err == nil {
err = closeErr
}
}()
defer r.HandleAccess(&err)()
}
// recovered by HandleAccess
mustPrintln := func(a ...any) {
if _, _err := fmt.Fprintln(w, a...); _err != nil {