Skip to content

Commit

Permalink
Fixes exit code of usage fuction.
Browse files Browse the repository at this point in the history
  • Loading branch information
aidin36 committed Sep 21, 2018
1 parent 4f4cd91 commit c1d9544
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import (
)

func usage(error string, args ...interface{}) {
exitCode := 0

if len(error) > 0 {
exitCode = 1

if len(args) > 0 {
fmt.Printf(fmt.Sprintf(error, args...))
} else {
Expand All @@ -26,5 +30,5 @@ e.g.
sql all "SELECT * FROM users WHERE name = 'John'"
For more detailed help, please go to: https://github.com/marianogappa/sql`)
os.Exit(1)
os.Exit(exitCode)
}

0 comments on commit c1d9544

Please sign in to comment.