From e577e7eae99a611bac9fa2175f6b4ee930e49fc9 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 3 Mar 2019 09:11:50 +0100 Subject: [PATCH] fixed display sent to stdout instead of stderr --- main.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 4d31a81..86c39a0 100644 --- a/main.go +++ b/main.go @@ -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" } @@ -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) }