diff options
author | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-08-04 13:03:53 +0000 |
---|---|---|
committer | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2004-08-04 13:03:53 +0000 |
commit | 28e7bd1e211d815edd248d7e33779f6e5c3f0b91 (patch) | |
tree | eb657913755cdcffc450aebde1bab5d9a31e8f05 | |
parent | 7b2fb843c94a611433afc555d72887fdc7f2ad0a (diff) |
Handler for the `Global_opt' request
-rw-r--r-- | usr.bin/cvs/req.c | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/usr.bin/cvs/req.c b/usr.bin/cvs/req.c index 54c03caa1ce..4bdb507f72c 100644 --- a/usr.bin/cvs/req.c +++ b/usr.bin/cvs/req.c @@ -1,4 +1,4 @@ -/* $OpenBSD: req.c,v 1.2 2004/08/04 12:41:58 jfb Exp $ */ +/* $OpenBSD: req.c,v 1.3 2004/08/04 13:03:52 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -58,6 +58,7 @@ extern int cvs_readonly; static int cvs_req_root (int, char *); static int cvs_req_directory (int, char *); static int cvs_req_argument (int, char *); +static int cvs_req_globalopt (int, char *); static int cvs_req_version (int, char *); @@ -86,7 +87,7 @@ struct cvs_reqhdlr { { NULL }, { cvs_req_argument }, /* 20 */ { cvs_req_argument }, - { NULL }, + { cvs_req_globalopt }, { NULL }, { NULL }, { NULL }, @@ -240,6 +241,43 @@ cvs_req_argument(int reqid, char *line) static int +cvs_req_globalopt(int reqid, char *line) +{ + if ((*line != '-') || (*(line + 2) != '\0')) { + cvs_log(LP_ERR, + "invalid `Global_option' request format"); + return (-1); + } + + switch (*(line + 1)) { + case 'l': + cvs_nolog = 1; + break; + case 'n': + break; + case 'Q': + verbosity = 0; + break; + case 'q': + if (verbosity > 1) + verbosity = 1; + break; + case 'r': + cvs_readonly = 1; + break; + case 't': + cvs_trace = 1; + break; + default: + cvs_log(LP_ERR, "unknown global option `%s'", line); + return (-1); + } + + return (0); +} + + +static int cvs_req_version(int reqid, char *line) { cvs_printf("%s\n", CVS_VERSION); |