refactor: write errors into stderr and add exit code

Instead of writing errors into stdout and alway returning exit code 0,
we now write into stderr and return exit code 1 in case that an error
occured.
This commit is contained in:
Niko Köser 2021-02-01 10:48:34 +01:00
parent 3ccd4d07e9
commit 0b60fef246
No known key found for this signature in database
GPG Key ID: F3F28C118DAA6375
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ package main
//go:generate git tag -af v$VERSION -m "v$VERSION"
import (
"fmt"
"log"
"github.com/schollz/croc/v8/src/cli"
)
@ -28,6 +28,6 @@ func main() {
// }
// }()
if err := cli.Run(); err != nil {
fmt.Println(err)
log.Fatalln(err)
}
}