diff options
author | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-09-24 12:19:22 +0000 |
---|---|---|
committer | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-09-24 12:19:22 +0000 |
commit | b145d67fc07b5582e085c24737b48818456db78b (patch) | |
tree | 05decd7d834b91c44ddea1b8a84f5223b7a86a0a /usr.bin/cvs | |
parent | ba785dab6248bcde04d4ff22282f7e0535cf6d53 (diff) |
Add a `-h' option to print the usage and exit with status 0 and fix
usage() indentation
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/cvsd.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/usr.bin/cvs/cvsd.c b/usr.bin/cvs/cvsd.c index 6a5b56fd912..7f203184a16 100644 --- a/usr.bin/cvs/cvsd.c +++ b/usr.bin/cvs/cvsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cvsd.c,v 1.5 2004/08/06 20:09:22 jfb Exp $ */ +/* $OpenBSD: cvsd.c,v 1.6 2004/09/24 12:19:21 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -140,12 +140,13 @@ void usage(void) { fprintf(stderr, - "Usage: %s [-dfpv] [-c config] [-r root] [-s path]\n" + "Usage: %s [-dfhpv] [-c config] [-r root] [-s path]\n" "\t-d\t\tStart the server in debugging mode (very verbose)\n" "\t-f\t\tStay in foreground instead of becoming a daemon\n" - "\t-p\t\tPerform permission and ownership check on the repository\n" - "\t-r root\tUse <root> as the root directory of the repository\n" - "\t-s path\tUse <path> as the path for the CVS server socket\n" + "\t-h\t\tPrint the usage and exit\n" + "\t-p\t\tPerform repository sanity check on startup\n" + "\t-r root\t\tUse <root> as the root directory of the repository\n" + "\t-s path\t\tUse <path> as the path for the CVS server socket\n" "\t-v\t\tBe verbose\n", __progname); } @@ -164,7 +165,7 @@ main(int argc, char **argv) if (cvs_log_init(LD_STD|LD_SYSLOG, LF_PID) < 0) err(1, "failed to initialize logging mechanism"); - while ((ret = getopt(argc, argv, "a:c:dfpr:s:v")) != -1) { + while ((ret = getopt(argc, argv, "a:c:dfhpr:s:v")) != -1) { switch (ret) { case 'c': cvsd_conffile = optarg; @@ -176,6 +177,11 @@ main(int argc, char **argv) case 'f': foreground = 1; break; + case 'h': + usage(); + exit(0); + /* NOTREACHED */ + break; case 'p': checkrepo = 1; break; |