MCPcopy Create free account
hub / github.com/driangle/taskmd / Flush

Method Flush

apps/cli/internal/cli/tablewriter.go:46–60  ·  view source on GitHub ↗

Flush computes column widths and writes all rows to w.

(w io.Writer)

Source from the content-addressed store, hash-verified

44
45// Flush computes column widths and writes all rows to w.
46func (tw *TableWriter) Flush(w io.Writer) {
47 if len(tw.rows) == 0 {
48 return
49 }
50
51 widths := tw.columnWidths()
52
53 for _, row := range tw.rows {
54 if row.isSep {
55 tw.writeSeparator(w, widths)
56 continue
57 }
58 tw.writeRow(w, row, widths)
59 }
60}
61
62// columnWidths returns the max visible width for each column.
63func (tw *TableWriter) columnWidths() []int {

Callers 15

outputNextTableFunction · 0.95
outputTagsTableFunction · 0.95
outputTracksTableFunction · 0.95
outputProjectsTableFunction · 0.95
outputStatsTableFunction · 0.95
outputSearchTableFunction · 0.95

Calls 3

columnWidthsMethod · 0.95
writeSeparatorMethod · 0.95
writeRowMethod · 0.95