Exit with status code 2 if no files were given
By convention exit(1) is reserved for general errors, while exit(2) means command misuse. Stdlib `flags` package invokes `os.Exit(2)` after printing out the usage message. This commit changes the empty files list exit code to be aligned with this behavior.
This commit is contained in:
parent
46e67d5848
commit
6bfd6215e6
@ -33,7 +33,7 @@ func main() {
|
||||
|
||||
if flag.NArg() == 0 {
|
||||
flag.Usage()
|
||||
os.Exit(1)
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
err = termbox.Init()
|
||||
|
Loading…
Reference in New Issue
Block a user