Skip to content

Commit

Permalink
add seperator flag
Browse files Browse the repository at this point in the history
  • Loading branch information
stroborobo committed Dec 12, 2012
1 parent beb92bc commit a4076f4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ import (
)

func main() {
var encoding string
flag.StringVar(&encoding, "enc", "", "input encoding, e.g. latin9, defaults to UTF-8")
var encoding, seperator string
flag.StringVar(&encoding, "e", "", "input encoding, e.g. latin9, defaults to UTF-8")
flag.StringVar(&seperator, "s", "|", "seperator string")
// TODO
//var alignRight bool
//flag.BoolVar(&alignRight, "r", false, "align values to the right instead to the left")

flag.Parse()

Expand Down Expand Up @@ -69,7 +73,7 @@ func main() {
for i, col := range row {
fmt.Printf(fmt.Sprint("%-", colLens[i] + 1, "s"), col)
if i != len(colLens) {
fmt.Print("| ")
fmt.Printf("%s ", seperator)
}
}
fmt.Print("\n")
Expand Down

0 comments on commit a4076f4

Please sign in to comment.