summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2005-05-29 16:36:55 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2005-05-29 16:36:55 +0000
commit64a0104841b9ee07157682e7424a15a387bb5a33 (patch)
treec240cfad8494459db973a64bedd65a4ec34504a3
parentaa994bd6d08d13983c1f1c4d9a4698db9458a873 (diff)
-D and -r are mutually exclusive ...
-rw-r--r--usr.bin/cvs/update.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c
index 6000ae3d6eb..8c585ebd321 100644
--- a/usr.bin/cvs/update.c
+++ b/usr.bin/cvs/update.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: update.c,v 1.31 2005/05/26 03:07:20 joris Exp $ */
+/* $OpenBSD: update.c,v 1.32 2005/05/29 16:36:54 xsa Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -64,6 +64,7 @@ struct cvs_cmd cvs_cmd_update = {
CVS_CMD_ALLOWSPEC | CVS_CMD_SENDARGS2 | CVS_CMD_SENDDIR
};
+static char *date, *rev;
static int dflag, Aflag;
static int
@@ -72,6 +73,8 @@ cvs_update_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg)
int ch;
dflag = Aflag = 0;
+ date = NULL;
+ rev = NULL;
while ((ch = getopt(argc, argv, cmd->cmd_opts)) != -1) {
switch (ch) {
@@ -80,6 +83,8 @@ cvs_update_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg)
break;
case 'C':
case 'D':
+ date = optarg;
+ break;
case 'd':
dflag = 1;
break;
@@ -101,12 +106,19 @@ cvs_update_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg)
cmd->file_flags |= CF_RECURSE;
break;
case 'r':
+ rev = optarg;
break;
default:
return (CVS_EX_USAGE);
}
}
+ if ((date != NULL) && (rev != NULL)) {
+ cvs_log(LP_ERR,
+ "the -D and -r arguments are mutually exclusive");
+ return (CVS_EX_USAGE);
+ }
+
*arg = optind;
return (0);
}