From 3ce76a4e0be8edef6ee90ff4edb291aadb200e99 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 21 Nov 2025 08:57:56 +0800 Subject: refactor: move print entry point to statistics.Print() --- print.go | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'print.go') diff --git a/print.go b/print.go index 1e7ce08..ca10b98 100644 --- a/print.go +++ b/print.go @@ -8,29 +8,14 @@ import ( "github.com/hako/durafmt" ) -// === Print Entry Point === // - -func PrintInfo(data *statistics) { - if data == nil { - fmt.Println("Package not found.") - return - } - - printHeader(data) - printUserInteractionSummary(data) - printMetadata(data) - - fmt.Println() -} - // === Main Sections === // -func printHeader(data *statistics) { +func PrintHeader(data *statistics) { printTypeNameAndDesc(data.Type, data.Name, data.Desc) fmt.Println() } -func printUserInteractionSummary(data *statistics) { +func PrintUserInteractionSummary(data *statistics) { a := printInstallDesc( data.Type == "formula", data.InstalledAsDependency, @@ -47,7 +32,7 @@ func printUserInteractionSummary(data *statistics) { } } -func printMetadata(data *statistics) { +func PrintMetadata(data *statistics) { printVersionInfo( data.InstalledVersion, data.Outdated) -- cgit v1.2.3