MCPcopy Create free account
hub / github.com/archlinux-de/pkgstats-cli / PrintPackagePopularities

Function PrintPackagePopularities

internal/api/request/printer.go:17–27  ·  view source on GitHub ↗
(writer io.Writer, ppl PackagePopularityList)

Source from the content-addressed store, hash-verified

15)
16
17func PrintPackagePopularities(writer io.Writer, ppl PackagePopularityList) {
18 w := tabwriter.NewWriter(writer, minWidth, 0, padding, ' ', 0)
19 for _, pkg := range ppl.PackagePopularities {
20 fmt.Fprintf(w, "%s\t%.2f\n", pkg.Name, pkg.Popularity)
21 }
22 w.Flush()
23
24 if ppl.Count > 0 && ppl.Total > 0 {
25 fmt.Fprintf(writer, "\n%d of %d results\n", ppl.Count, ppl.Total)
26 }
27}
28
29func PrintSearchURL(writer io.Writer, baseURL string, query string) {
30 if len(query) > 0 {

Callers 3

newSearchCmdFunction · 0.92
newShowCmdFunction · 0.92

Calls

no outgoing calls

Tested by 1