Skip to content

Commit

Permalink
fixed display sent to stdout instead of stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Mar 3, 2019
1 parent 681e207 commit 437b017
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ func main() {
flag.Parse()

if v {
fmt.Printf("splitsh-lite version %s\n", version)
fmt.Fprintf(os.Stderr, "splitsh-lite version %s\n", version)
os.Exit(0)
}

if len(prefixes) == 0 {
fmt.Println("You must provide the directory to split via the --prefix flag")
fmt.Fprintf(os.Stderr, "You must provide the directory to split via the --prefix flag")
os.Exit(1)
}

Expand Down Expand Up @@ -100,9 +100,8 @@ func main() {
}()
}

err := splitter.Split(config, result)
if err != nil {
fmt.Println(err)
if err := splitter.Split(config, result); err != nil {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(1)
}

Expand Down

0 comments on commit 437b017

Please sign in to comment.