summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-x.bin/xx.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/.bin/xx.c b/.bin/xx.c
index 5ee22f6f..9b8f5d0f 100755
--- a/.bin/xx.c
+++ b/.bin/xx.c
@@ -7,6 +7,7 @@ exec clang -Weverything -Wno-vla $@ -o $(dirname $0)/xx $0
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <sysexits.h>
 #include <unistd.h>
 
 static bool zero(const uint8_t *buf, size_t len) {
@@ -41,17 +42,17 @@ int main(int argc, char **argv) {
             flags ^= FLAG_SKIP;
         else {
             fprintf(stderr, "usage: xx [-afk] [-c N] [-g N] [FILE]\n");
-            return (opt == 'h') ? EXIT_SUCCESS : EXIT_FAILURE;
+            return (opt == 'h') ? EX_OK : EX_USAGE;
         }
     }
-    if (!cols) return EXIT_FAILURE;
+    if (!cols) return EX_USAGE;
     if (argc > optind)
         path = argv[optind];
 
     FILE *file = path ? fopen(path, "r") : stdin;
     if (!file) {
         perror(path);
-        return EXIT_FAILURE;
+        return EX_NOINPUT;
     }
 
     uint8_t buf[cols];
@@ -93,7 +94,7 @@ int main(int argc, char **argv) {
 
     if (ferror(file)) {
         perror(path);
-        return EXIT_FAILURE;
+        return EX_IOERR;
     }
-    return EXIT_SUCCESS;
+    return EX_OK;
 }
ig/nvim/colors/subtle.vim?id=bd37d64e2fce4d29c0d41686fea27bef588f5fb5&follow=1'>Color macros in yellowJune McEnroe 2016-07-26Colorscheme colors and schemesJune McEnroe 2016-07-26Add ''subtle'' colorschemeJune McEnroe 2016-07-26Add htoprcJune McEnroe 2016-07-24Add may and refactor ssh configJune McEnroe 2016-07-18Disable cursorlineJune McEnroe 2016-07-18Use hard constrast gruvbox darkJune McEnroe 2016-07-15Remove vim configurationJune McEnroe 2016-07-15Add readline to README configurations listJune McEnroe 2016-07-15Add vendor script to READMEJune McEnroe 2016-07-15Pull latest pathogen and gruvboxJune McEnroe