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 e577e7e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ 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.Fprintln(os.Stderr, "You must provide the directory to split via the --prefix flag")
os.Exit(1)
}

if legacy {
fmt.Fprintf(os.Stderr, `The --legacy option is deprecated (use --git="<1.8.2" instead)`)
fmt.Fprintln(os.Stderr, `The --legacy option is deprecated (use --git="<1.8.2" instead)`)
gitVersion = "<1.8.2"
}

Expand All @@ -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 e577e7e

Please sign in to comment.