Skip to content

Commit

Permalink
Set the exit code as failure in errors
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch committed Nov 1, 2018
1 parent 32642d0 commit e178431
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ func main() {
}
if len(args) > 1 {
fmt.Fprintf(os.Stderr, "A single command must be specified.\n")
return
os.Exit(1)
}

command := strings.ToLower(args[0])

raw, ok := files[command]
if !ok {
fmt.Fprintf(os.Stderr, "Command %s is not known.\n", command)
return
os.Exit(1)
}
text := string(raw)

Expand Down

0 comments on commit e178431

Please sign in to comment.