]> ruderich.org/simon Gitweb - wall-notify/wall-notify.git/commitdiff
move usage display to separate function
authorSimon Ruderich <simon@ruderich.org>
Tue, 13 May 2014 21:39:30 +0000 (23:39 +0200)
committerSimon Ruderich <simon@ruderich.org>
Tue, 13 May 2014 21:39:30 +0000 (23:39 +0200)
src/wall-notify.c

index dd37e897a03ccea27adb731e0466fea59b232f6f..24afb7a1f90295f3cf69e80e6815dbbbb189e10a 100644 (file)
@@ -294,14 +294,18 @@ static void handle_wall(int fd, char **argv) {
     }
 }
 
+static void usage(const char *argv0) {
+    fprintf(stderr, "usage: %s <cmd args..>\n", argv0);
+    exit(EXIT_FAILURE);
+}
+
 
 int main(int argc, char **argv) {
     int ptm, pts;
     char *name;
 
     if (argc < 2) {
-        fprintf(stderr, "usage: %s <cmd args..>\n", argv[0]);
-        exit(EXIT_FAILURE);
+        usage(argv[0]);
     }
 
     ptm = open_tty();