MCPcopy Create free account
hub / github.com/NikonP/fetchfetch / main

Function main

fetchfetch.go:29–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27)
28
29func main() {
30 t := table.NewWriter()
31 t.SetOutputMirror(os.Stdout)
32 t.SetAllowedRowLength(80)
33 t.SetStyle(table.StyleColoredGreenWhiteOnBlack)
34
35 t.AppendHeader(table.Row{
36 "Fetch",
37 "Description",
38 "Is installed",
39 })
40
41 installedCount := 0
42 totalFetchesCount := len(fetch.Fetches)
43
44 for _, fetch := range fetch.Fetches {
45 isInstalled := ""
46
47 if fetch.FetchExists() {
48 installedCount += 1
49 isInstalled = text.FgGreen.Sprint("[+]")
50 }
51
52 t.AppendRow(table.Row{
53 fetch.Name,
54 fetch.Description,
55 isInstalled,
56 })
57 }
58
59 t.AppendFooter(table.Row{
60 "",
61 "",
62 fmt.Sprintf(
63 "%d/%d",
64 installedCount,
65 totalFetchesCount,
66 ),
67 })
68
69 t.AppendSeparator()
70
71 t.Render()
72
73 t = table.NewWriter()
74 t.SetOutputMirror(os.Stdout)
75 t.SetAllowedRowLength(80)
76 t.SetStyle(table.StyleColoredGreenWhiteOnBlack)
77}

Callers

nothing calls this directly

Calls 1

FetchExistsMethod · 0.80

Tested by

no test coverage detected