[hackers] [st] use errx() for help and version messages || Matthias-Christian Ott

From: <hg_AT_suckless.org>
Date: Thu, 7 Aug 2008 00:21:20 +0000 (UTC)

changeset: 35:436c865e4b0c
user: Matthias-Christian Ott <ott_AT_enolink.de>
date: Mon Jul 21 09:25:25 2008 +0200
files: std.c
description:
use errx() for help and version messages

diff -r 34acf2e232fd -r 436c865e4b0c std.c
--- a/std.c Thu Jul 10 22:43:24 2008 +0200
+++ b/std.c Mon Jul 21 09:25:25 2008 +0200
@@ -265,14 +265,10 @@
 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);
Received on Thu Aug 07 2008 - 00:21:20 UTC

This archive was generated by hypermail 2.2.0 : Thu Aug 07 2008 - 00:24:07 UTC