summaryrefslogtreecommitdiff
path: root/humanTable.go
diff options
context:
space:
mode:
Diffstat (limited to 'humanTable.go')
-rw-r--r--humanTable.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/humanTable.go b/humanTable.go
index 17b84a1..caf0bba 100644
--- a/humanTable.go
+++ b/humanTable.go
@@ -30,7 +30,7 @@ func StandardTableRow(sizes []int, args []string) (string, string) {
}
fmts = append(fmts, sfmt)
if len(args) > i {
- val := args[i]
+ val := strings.Join(strings.Fields(args[i]), " ") // removes all newlines
cell = fmt.Sprintf(sfmt, val)
parts = append(parts, cell)
} else {
@@ -52,7 +52,8 @@ func StandardTableRow(sizes []int, args []string) (string, string) {
// small = 0
// }
}
- return line[0:small], strings.Join(fmts, " ")
+ smalls := fmt.Sprintf("small=%d", small)
+ return line[0:small], strings.Join(fmts, " ") + " " + smalls
}
func StandardTableRowDebug(sizes []int, args []string) (string, string) {
@@ -62,7 +63,8 @@ func StandardTableRowDebug(sizes []int, args []string) (string, string) {
// cell = fmt.Sprintf(sfmt, val)
}
}
- return StandardTableRow(sizes, args)
+ line, fmts := StandardTableRow(sizes, args)
+ return line, fmts
}
/*