diff options
author | Matthias-Christian Ott <ott@enolink.de> | 2008-07-21 09:25:25 +0200 |
---|---|---|
committer | Matthias-Christian Ott <ott@enolink.de> | 2008-07-21 09:25:25 +0200 |
commit | 019a118b67e9aec870d643cdd42f7f36b2ea3a86 (patch) | |
tree | 8eb3a667a45f762284ced709cb9d06a9a20820f5 /std.c | |
parent | 399355740410695859db7f7816fd906a27427fad (diff) | |
download | st-019a118b67e9aec870d643cdd42f7f36b2ea3a86.tar.gz st-019a118b67e9aec870d643cdd42f7f36b2ea3a86.tar.bz2 |
use errx() for help and version messages
Diffstat (limited to 'std.c')
-rw-r--r-- | std.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -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); |