use errx() for help and version messages
authorMatthias-Christian Ott <ott@enolink.de>
Mon, 21 Jul 2008 07:25:25 +0000 (09:25 +0200)
committerMatthias-Christian Ott <ott@enolink.de>
Mon, 21 Jul 2008 07:25:25 +0000 (09:25 +0200)
std.c

diff --git a/std.c b/std.c
index 3e155e6..5c12fbd 100644 (file)
--- a/std.c
+++ b/std.c
@@ -265,14 +265,10 @@ int
 main(int argc, char *argv[]) {
        fd_set rfds;
 
-       if(argc == 2 && !strcmp("-v", argv[1])) {
-               fprintf(stderr, "std-"VERSION", © 2008 Matthias-Christian Ott\n");
-               exit(EXIT_SUCCESS);
-       }
-       else if(argc == 1) {
-               fprintf(stderr, "usage: st [-v]\n");
-               exit(EXIT_FAILURE);
-       }
+       if(argc == 2 && !strcmp("-v", argv[1]))
+               errx(EXIT_SUCCESS, "std-"VERSION", © 2008 Matthias-Christian Ott");
+       else if(argc == 1)
+               errx(EXIT_FAILURE, "usage: st [-v]");
        getpty();
        shell();
        FD_ZERO(&rfds);