use errx() for help and version messages - st - Personal fork of st
 (HTM) git clone git://git.drkhsh.at/st.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 746931a3d4114f9bd35a43307fd48bfa64ff0d8b
 (DIR) parent a95f4f2ed9772599c491e582e65f90ff4fd7085d
 (HTM) Author: Matthias-Christian Ott <ott@enolink.de>
       Date:   Mon, 21 Jul 2008 09:25:25 +0200
       
       use errx() for help and version messages
       
       Diffstat:
         M std.c                               |      12 ++++--------
       
       1 file changed, 4 insertions(+), 8 deletions(-)
       ---
 (DIR) diff --git 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);