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:
Andrew Slotin 2017-10-12 11:52:33 +07:00
parent 46e67d5848
commit 6bfd6215e6
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ func main() {
if flag.NArg() == 0 {
flag.Usage()
os.Exit(1)
os.Exit(2)
}
err = termbox.Init()