mirror of
https://github.com/charmbracelet/gum
synced 2024-05-17 21:56:42 +02:00
Use encoding/csv to write proper CSV for the selected row
This commit is contained in:
parent
5ed1f2b1b8
commit
e20d3a97f0
|
@ -4,7 +4,6 @@ import (
|
|||
"encoding/csv"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/alecthomas/kong"
|
||||
"github.com/charmbracelet/bubbles/table"
|
||||
|
@ -102,7 +101,11 @@ func (o Options) Run() error {
|
|||
}
|
||||
|
||||
m := tm.(model)
|
||||
fmt.Println(strings.Join([]string(m.selected), o.Separator))
|
||||
|
||||
w := csv.NewWriter(os.Stdout)
|
||||
w.Comma = reader.Comma
|
||||
w.Write([]string(m.selected))
|
||||
w.Flush()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue