summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-09-29 21:30:11 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-09-29 21:30:11 +0000
commit1a291f79aac038207f18b3e4a425118d8ffeb797 (patch)
tree6f9b74765299df6830c562ab50325dae9fb709e3 /usr.bin
parentbc4c07077070604da4a0ba814f8340bb2167f2ba (diff)
support -q flag in 'co' and 'rcs'
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/rcs/co.c7
-rw-r--r--usr.bin/rcs/rcsprog.c27
-rw-r--r--usr.bin/rcs/rcsprog.h3
3 files changed, 24 insertions, 13 deletions
diff --git a/usr.bin/rcs/co.c b/usr.bin/rcs/co.c
index 8b66c2b6df8..e88e3106b7d 100644
--- a/usr.bin/rcs/co.c
+++ b/usr.bin/rcs/co.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: co.c,v 1.2 2005/09/29 15:21:57 joris Exp $ */
+/* $OpenBSD: co.c,v 1.3 2005/09/29 21:30:10 joris Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -48,8 +48,11 @@ checkout_main(int argc, char **argv)
char *s, fpath[MAXPATHLEN];
rev = RCS_HEAD_REV;
- while ((ch = getopt(argc, argv, "r:")) != -1) {
+ while ((ch = getopt(argc, argv, "qr:")) != -1) {
switch (ch) {
+ case 'q':
+ verbose = 0;
+ break;
case 'r':
if ((rev = rcsnum_parse(optarg)) == NULL) {
cvs_log(LP_ERR, "bad revision number");
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c
index a62416f826b..219f024f949 100644
--- a/usr.bin/rcs/rcsprog.c
+++ b/usr.bin/rcs/rcsprog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.c,v 1.11 2005/09/29 15:19:51 joris Exp $ */
+/* $OpenBSD: rcsprog.c,v 1.12 2005/09/29 21:30:10 joris Exp $ */
/*
* Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -44,6 +44,7 @@
#include "strtab.h"
const char rcs_version[] = "OpenCVS RCS version 3.6";
+int verbose = 1;
struct rcs_prog {
char *prog_name;
@@ -84,14 +85,16 @@ rcs_statfile(char *fname, char *out, size_t len)
}
strlcpy(out, fpath, len);
- if (!strcmp(__progname, "co")) {
- printf("%s --> ", filev);
- if ((s = strrchr(filev, ',')) != NULL) {
- *s = '\0';
- printf("%s\n", fname);
+ if (verbose) {
+ if (!strcmp(__progname, "co")) {
+ printf("%s --> ", filev);
+ if ((s = strrchr(filev, ',')) != NULL) {
+ *s = '\0';
+ printf("%s\n", fname);
+ }
+ } else {
+ printf("RCS file: %s\n", fpath);
}
- } else {
- printf("RCS file: %s\n", fpath);
}
return (0);
@@ -148,7 +151,7 @@ rcs_main(int argc, char **argv)
flags = RCS_RDWR;
oldfile = alist = comment = elist = NULL;
- while ((ch = getopt(argc, argv, "A:a:b::c:e::hik:LMUV")) != -1) {
+ while ((ch = getopt(argc, argv, "A:a:b::c:e::hik:LMqUV")) != -1) {
switch (ch) {
case 'A':
oldfile = optarg;
@@ -185,6 +188,9 @@ rcs_main(int argc, char **argv)
case 'M':
/* ignore for the moment */
break;
+ case 'q':
+ verbose = 0;
+ break;
case 'U':
if (lkmode == RCS_LOCK_STRICT)
cvs_log(LP_WARN, "-L overriden by -U");
@@ -240,7 +246,8 @@ rcs_main(int argc, char **argv)
rcs_close(file);
- printf("done\n");
+ if (verbose)
+ printf("done\n");
}
return (0);
diff --git a/usr.bin/rcs/rcsprog.h b/usr.bin/rcs/rcsprog.h
index e7520dad67d..3c48118e0c0 100644
--- a/usr.bin/rcs/rcsprog.h
+++ b/usr.bin/rcs/rcsprog.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.h,v 1.1 2005/09/29 15:13:19 joris Exp $ */
+/* $OpenBSD: rcsprog.h,v 1.2 2005/09/29 21:30:10 joris Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -29,6 +29,7 @@
extern char *__progname;
extern const char rcs_version[];
+extern int verbose;
void rcs_usage(void);
void checkout_usage(void);