X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=std.c;h=5c12fbd6774a47c53401cb5f71ec17bf4aa15847;hb=746931a3d4114f9bd35a43307fd48bfa64ff0d8b;hp=5bc27b8dfa34533842ee61135f23d6887f7ebdeb;hpb=0cbcedb89ffe6e29b3c0640f371bed578c6e0c07;p=st.git diff --git a/std.c b/std.c index 5bc27b8..5c12fbd 100644 --- a/std.c +++ b/std.c @@ -41,7 +41,7 @@ typedef struct { static int cols = 80, lines = 25; static int cx = 0, cy = 0; static int c; -static int ptm, pts; +int ptm, pts; static _Bool bold, digit, qmark; static pid_t pid; static RingBuffer buf; @@ -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);