chiark
/
gitweb
/
~mdw
/
adns
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
+ * adnslogres has --help option.
[adns]
/
client
/
adnslogres.c
diff --git
a/client/adnslogres.c
b/client/adnslogres.c
index 3aa7e0eea867e619a4e9c577760e1eb1323c9240..a91127b128b62acdea5654ad918407c0ab0fdf45 100644
(file)
--- a/
client/adnslogres.c
+++ b/
client/adnslogres.c
@@
-218,9
+218,13
@@
static void proclog(FILE *inf, FILE *outf, int maxpending, int opts) {
adns_finish(adns);
}
adns_finish(adns);
}
-static void
usage(void
) {
- fprintf(
stderr
, "usage: %s [-d] [-p] [-c concurrency] [-C config] [logfile]\n",
+static void
printhelp(FILE *file
) {
+ fprintf(
file
, "usage: %s [-d] [-p] [-c concurrency] [-C config] [logfile]\n",
progname);
progname);
+}
+
+static void usage(void) {
+ printhelp(stderr);
exit(1);
}
exit(1);
}
@@
-229,6
+233,12
@@
int main(int argc, char *argv[]) {
extern char *optarg;
FILE *inf;
extern char *optarg;
FILE *inf;
+ if (argv[1] && !strcmp(argv[1],"--help")) {
+ printhelp(stdout);
+ if (ferror(stdout) || fclose(stdout)) { perror("stdout"); exit(1); }
+ exit(0);
+ }
+
maxpending= DEFMAXPENDING;
opts= 0;
while ((c= getopt(argc, argv, "c:C:dp")) != -1)
maxpending= DEFMAXPENDING;
opts= 0;
while ((c= getopt(argc, argv, "c:C:dp")) != -1)