diff --git a/main.go b/main.go index 4d31a81..e36167d 100644 --- a/main.go +++ b/main.go @@ -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) } @@ -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) }