chiark / gitweb /
driverd: implement AddMatch/RemoveMatch logic
[elogind.git] / src / journal / cat.c
index 523a7a2eda39985d00f2cc6b35603ebd0a18b980..02b75642a33ab9fb3de3e30c20fea8607db73909 100644 (file)
@@ -25,7 +25,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <errno.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 
 #include <systemd/sd-journal.h>
 
@@ -63,7 +63,7 @@ static int parse_argv(int argc, char *argv[]) {
                 { "identifier",   required_argument, NULL, 't'              },
                 { "priority",     required_argument, NULL, 'p'              },
                 { "level-prefix", required_argument, NULL, ARG_LEVEL_PREFIX },
-                { NULL,           0,                 NULL, 0                }
+                {}
         };
 
         int c;
@@ -76,12 +76,10 @@ static int parse_argv(int argc, char *argv[]) {
                 switch (c) {
 
                 case 'h':
-                        help();
-                        return 0;
+                        return help();
 
                 case ARG_VERSION:
                         puts(PACKAGE_STRING);
-                        puts(DISTRIBUTION);
                         puts(SYSTEMD_FEATURES);
                         return 0;
 
@@ -116,9 +114,11 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
                 }
 
-                default:
-                        log_error("Unknown option code %c", c);
+                case '?':
                         return -EINVAL;
+
+                default:
+                        assert_not_reached("Unhandled option");
                 }
         }