From 6bfd6215e6eec4d9b8a07454bc65a9b9b27bcc10 Mon Sep 17 00:00:00 2001 From: Andrew Slotin Date: Thu, 12 Oct 2017 11:52:33 +0700 Subject: [PATCH] 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. --- boltbrowser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boltbrowser.go b/boltbrowser.go index 0dcd2e1..f2ddbb8 100644 --- a/boltbrowser.go +++ b/boltbrowser.go @@ -33,7 +33,7 @@ func main() { if flag.NArg() == 0 { flag.Usage() - os.Exit(1) + os.Exit(2) } err = termbox.Init()