summaryrefslogtreecommitdiff
path: root/usr.bin/rcs
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2006-05-11 09:43:20 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2006-05-11 09:43:20 +0000
commit6003f9c19f469cd7eb74a1ab3f4f300bd1df7fb2 (patch)
treeaeb252aeb66e52dd873cde9f6d86bc65f8e9b7df /usr.bin/rcs
parentafce4245e4053873827a44c5265d09ec0d9073f5 (diff)
fix informative msg's wrt to -q and stderr. now matches gnu/usr.bin/rcs.
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r--usr.bin/rcs/co.c17
-rw-r--r--usr.bin/rcs/rcsprog.c11
2 files changed, 16 insertions, 12 deletions
diff --git a/usr.bin/rcs/co.c b/usr.bin/rcs/co.c
index de033777082..3d6b04fad72 100644
--- a/usr.bin/rcs/co.c
+++ b/usr.bin/rcs/co.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: co.c,v 1.89 2006/05/09 12:33:42 ray Exp $ */
+/* $OpenBSD: co.c,v 1.90 2006/05/11 09:43:19 xsa Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -156,7 +156,7 @@ checkout_main(int argc, char **argv)
continue;
if (!(flags & QUIET))
- printf("%s --> %s\n", fpath,
+ (void)fprintf(stderr, "%s --> %s\n", fpath,
(flags & PIPEOUT) ? "standard output" : argv[i]);
if ((flags & CO_LOCK) && (kflag & RCS_KWEXP_VAL)) {
@@ -197,7 +197,7 @@ checkout_main(int argc, char **argv)
}
if (!(flags & QUIET))
- printf("done\n");
+ (void)fprintf(stderr, "done\n");
rcsnum_free(rev);
@@ -257,8 +257,9 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags,
if (date != NULL)
givendate = rcs_date_parse(date);
- if (file->rf_ndelta == 0)
- printf("no revisions present; generating empty revision 0.0\n");
+ if (file->rf_ndelta == 0 && !(flags & QUIET))
+ (void)fprintf(stderr,
+ "no revisions present; generating empty revision 0.0\n");
/* XXX rcsnum_cmp()
* Check out the latest revision if <frev> is greater than HEAD
@@ -415,15 +416,15 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags,
}
}
- if (file->rf_ndelta == 0 &&
+ if (file->rf_ndelta == 0 && !(flags & QUIET) &&
((flags & CO_LOCK) || (flags & CO_UNLOCK))) {
- warnx("no revisions, so nothing can be %s",
+ (void)fprintf(stderr, "no revisions, so nothing can be %s",
(flags & CO_LOCK) ? "locked" : "unlocked");
} else if (file->rf_ndelta != 0) {
/* XXX - Not a good way to detect if a newline is needed. */
if (!(flags & QUIET) && !(flags & NEWFILE) &&
!(flags & CO_REVERT))
- printf("\n");
+ (void)fprintf(stderr, "\n");
}
if (flags & CO_LOCK) {
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c
index 390fed33dd9..40d65d1cf2c 100644
--- a/usr.bin/rcs/rcsprog.c
+++ b/usr.bin/rcs/rcsprog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.c,v 1.124 2006/05/09 12:33:42 ray Exp $ */
+/* $OpenBSD: rcsprog.c,v 1.125 2006/05/11 09:43:19 xsa Exp $ */
/*
* Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -307,7 +307,7 @@ rcs_main(int argc, char **argv)
continue;
if (!(rcsflags & QUIET))
- printf("RCS file: %s\n", fpath);
+ (void)fprintf(stderr, "RCS file: %s\n", fpath);
if ((file = rcs_open(fpath, fd, flags, fmode)) == NULL)
continue;
@@ -468,7 +468,10 @@ rcs_main(int argc, char **argv)
*/
if (rdp->rd_flags & RCS_RD_SELECT) {
rcsnum_tostr(rdp->rd_num, b, sizeof(b));
- printf("deleting revision %s\n", b);
+ if (!(rcsflags & QUIET)) {
+ (void)fprintf(stderr, "deleting"
+ " revision %s\n", b);
+ }
(void)rcs_rev_remove(file, rdp->rd_num);
}
}
@@ -482,7 +485,7 @@ rcs_main(int argc, char **argv)
rcs_close(file);
if (!(rcsflags & QUIET))
- printf("done\n");
+ (void)fprintf(stderr, "done\n");
}
if (logstr != NULL)