diff options
author | Joshua Stein <jcs@cvs.openbsd.org> | 2016-08-31 13:09:10 +0000 |
---|---|---|
committer | Joshua Stein <jcs@cvs.openbsd.org> | 2016-08-31 13:09:10 +0000 |
commit | 7f6a758fac411f45e78a0aa5fc15aaa305aa7fb2 (patch) | |
tree | aae422f99da13366560d664f4ab30dce30673353 | |
parent | 9ac87553a91012491d9a20d80b1c67371f7e7174 (diff) |
rlog: add -E and -S options to configure revision separators, to
work around commits that might have the default strings in them
ok tom deraadt
-rw-r--r-- | usr.bin/rcs/rlog.1 | 16 | ||||
-rw-r--r-- | usr.bin/rcs/rlog.c | 27 |
2 files changed, 31 insertions, 12 deletions
diff --git a/usr.bin/rcs/rlog.1 b/usr.bin/rcs/rlog.1 index d3826c02b0a..142d40409ee 100644 --- a/usr.bin/rcs/rlog.1 +++ b/usr.bin/rcs/rlog.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rlog.1,v 1.24 2010/09/03 11:09:29 jmc Exp $ +.\" $OpenBSD: rlog.1,v 1.25 2016/08/31 13:09:09 jcs Exp $ .\" .\" Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org> .\" All rights reserved. @@ -14,7 +14,7 @@ .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.Dd $Mdocdate: September 3 2010 $ +.Dd $Mdocdate: August 31 2016 $ .Dt RLOG 1 .Os .Sh NAME @@ -24,8 +24,10 @@ .Nm .Op Fl bhLNRtV .Op Fl d Ns Ar dates +.Op Fl E Ns Ar endsep .Op Fl l Ns Op Ar lockers .Op Fl r Ns Op Ar revs +.Op Fl S Ns Ar revsep .Op Fl s Ns Ar states .Op Fl w Ns Op Ar logins .Op Fl x Ns Ar suffixes @@ -82,6 +84,11 @@ character. See also the .Fl z option, below. +.It Fl E Ns Ar endsep +Print +.Ar endsep +at the end of each RCS file, instead of the default string of +77 equal signs. .It Fl h Print the RCS header, describing a file's branch, lock details, symbolic names, etc. @@ -131,6 +138,11 @@ and Without argument, the .Fl r option means the latest revision of the default branch. +.It Fl S Ns Ar revsep +Print +.Ar revsep +at the end of each RCS revision, instead of the default string of +28 dash signs. .It Fl s Ns Ar states Print information about revisions whose state matches one of the specified diff --git a/usr.bin/rcs/rlog.c b/usr.bin/rcs/rlog.c index 20b6b782d70..3df4334680b 100644 --- a/usr.bin/rcs/rlog.c +++ b/usr.bin/rcs/rlog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rlog.c,v 1.72 2016/08/26 09:02:54 guenther Exp $ */ +/* $OpenBSD: rlog.c,v 1.73 2016/08/31 13:09:09 jcs Exp $ */ /* * Copyright (c) 2005, 2009 Joris Vink <joris@openbsd.org> * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org> @@ -47,10 +47,7 @@ static int rlog_select_daterev(RCSFILE *, char *); static void rlog_file(const char *, RCSFILE *); static void rlog_rev_print(struct rcs_delta *); -#define RLOG_OPTSTRING "d:hLl::NqRr::s:TtVw::x::z::" -#define REVSEP "----------------------------" -#define REVEND \ - "=============================================================================" +#define RLOG_OPTSTRING "d:E:hLl::NqRr::S:s:TtVw::x::z::" static int dflag, hflag, Lflag, lflag, rflag, tflag, Nflag, wflag; static char *llist = NULL; @@ -58,14 +55,18 @@ static char *slist = NULL; static char *wlist = NULL; static char *revisions = NULL; static char *rlog_dates = NULL; +static char *revsep = "----------------------------"; +static char *revend = "=====================================================" + "========================"; __dead void rlog_usage(void) { fprintf(stderr, - "usage: rlog [-bhLNRtV] [-ddates] [-l[lockers]] [-r[revs]]\n" - " [-sstates] [-w[logins]] [-xsuffixes]\n" - " [-ztz] file ...\n"); + "usage: rlog [-bhLNRtV] [-ddates] [-Eendsep] [-l[lockers]] " + "[-r[revs]]\n" + " [-Srevsep] [-sstates] [-w[logins]] [-xsuffixes] " + "[-ztz] file ...\n"); exit(1); } @@ -86,6 +87,9 @@ rlog_main(int argc, char **argv) dflag = 1; rlog_dates = rcs_optarg; break; + case 'E': + revend = rcs_optarg; + break; case 'h': hflag = 1; break; @@ -111,6 +115,9 @@ rlog_main(int argc, char **argv) rflag = 1; revisions = rcs_optarg; break; + case 'S': + revsep = rcs_optarg; + break; case 's': slist = rcs_optarg; break; @@ -421,7 +428,7 @@ rlog_file(const char *fname, RCSFILE *file) } } - printf("%s\n", REVEND); + printf("%s\n", revend); } static void @@ -502,7 +509,7 @@ rlog_rev_print(struct rcs_delta *rdp) (slist != NULL || lflag == 1 || wflag == 1)) && found == 0)) return; - printf("%s\n", REVSEP); + printf("%s\n", revsep); rcsnum_tostr(rdp->rd_num, numb, sizeof(numb)); |