chiark / gitweb /
event: add ability to change fd of an active event source
[elogind.git] / src / journal / cat.c
index ea615783531eeb9a34dcf558020ed7885780328f..02b75642a33ab9fb3de3e30c20fea8607db73909 100644 (file)
@@ -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,8 +76,7 @@ static int parse_argv(int argc, char *argv[]) {
                 switch (c) {
 
                 case 'h':
-                        help();
-                        return 0;
+                        return help();
 
                 case ARG_VERSION:
                         puts(PACKAGE_STRING);
@@ -115,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");
                 }
         }