mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-17 04:30:56 +01:00
fixed -X output in combination with -c
This commit is contained in:
@@ -137,22 +137,14 @@ func printAsciiData(data *Tabdata) {
|
||||
*/
|
||||
func printExtendedData(data *Tabdata) {
|
||||
// needed for data output
|
||||
format := fmt.Sprintf("%%%ds: %%s\n", data.maxwidthHeader) // FIXME: re-calculate if -c has been set
|
||||
format := fmt.Sprintf("%%%ds: %%s\n", data.maxwidthHeader)
|
||||
|
||||
if len(data.entries) > 0 {
|
||||
var idx int
|
||||
for _, entry := range data.entries {
|
||||
idx = 0
|
||||
for i, value := range entry {
|
||||
if len(Columns) > 0 {
|
||||
if !contains(UseColumns, i+1) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
color.Printf(format, data.headers[idx], value)
|
||||
idx++
|
||||
color.Printf(format, data.headers[i], value)
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user