~mendelmaleh/pfin

22208af5c603c97aaf11b0f8b555a4d74819df56 — Mendel E 5 months ago 973d4c5
Add tsv preset to csvsum
1 files changed, 7 insertions(+), 0 deletions(-)

M cmd/csvsum/main.go
M cmd/csvsum/main.go => cmd/csvsum/main.go +7 -0
@@ 21,6 21,7 @@ type Opts struct {
	Untab   bool

	PSV bool
	TSV bool
}

func main() {


@@ 35,6 36,7 @@ func main() {

	// presets
	flag.BoolVar(&opts.PSV, "psv", false, "use psv preset")
	flag.BoolVar(&opts.TSV, "tsv", false, "use tsv preset")

	flag.Parse()



@@ 46,6 48,11 @@ func main() {
		opts.Untab = true
	}

	if opts.TSV {
		opts.Comma = "\t"
		opts.Comment = "-"
	}

	// data
	data, err := ioutil.ReadAll(os.Stdin)
	if err != nil {