Add dry-run flag and implement AUR support

This commit is contained in:
AI Bot
2026-04-13 21:42:11 +02:00
committed by Riyyi
parent bd789ab18d
commit 521b862919
10 changed files with 395 additions and 29 deletions
+17 -2
View File
@@ -1,12 +1,27 @@
package output
import "fmt"
import (
"fmt"
"strings"
)
type Result struct {
Installed int
Removed int
ToInstall []string
ToRemove []string
}
func Format(r *Result) string {
return fmt.Sprintf("Installed %d packages, removed %d packages", r.Installed, r.Removed)
var b strings.Builder
b.WriteString(fmt.Sprintf("Installed %d packages, removed %d packages", r.Installed, r.Removed))
if len(r.ToInstall) > 0 {
b.WriteString("\nWould install: ")
b.WriteString(strings.Join(r.ToInstall, ", "))
}
if len(r.ToRemove) > 0 {
b.WriteString("\nWould remove: ")
b.WriteString(strings.Join(r.ToRemove, ", "))
}
return b.String()
}