From fb9bb9b25c048b8a5748cc635916b67efbf879a6 Mon Sep 17 00:00:00 2001 From: Xavier Santolaria Date: Thu, 19 May 2005 15:37:51 +0000 Subject: - add missing flags for the log command - enable the -h -N -R -t options ok joris --- usr.bin/cvs/cvs.c | 4 ++-- usr.bin/cvs/getlog.c | 38 +++++++++++++++++++++++++++++++------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/usr.bin/cvs/cvs.c b/usr.bin/cvs/cvs.c index 33b99caf33f..2c81f1e56d9 100644 --- a/usr.bin/cvs/cvs.c +++ b/usr.bin/cvs/cvs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.c,v 1.63 2005/05/18 11:53:38 xsa Exp $ */ +/* $OpenBSD: cvs.c,v 1.64 2005/05/19 15:37:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -183,7 +183,7 @@ struct cvs_cmd cvs_cdt[] = { { CVS_OP_LOG, "log", { "lo" }, &cvs_getlog, "[-bhlNRt] [-d dates] [-r revisions] [-s states] [-w logins]", - "d:hlRr:", + "bd:hlNRrs:tw", "Print out history information for files", NULL }, diff --git a/usr.bin/cvs/getlog.c b/usr.bin/cvs/getlog.c index f60308eb280..d5d42cb1cd5 100644 --- a/usr.bin/cvs/getlog.c +++ b/usr.bin/cvs/getlog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getlog.c,v 1.24 2005/05/11 22:50:09 joris Exp $ */ +/* $OpenBSD: getlog.c,v 1.25 2005/05/19 15:37:50 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. @@ -47,14 +47,14 @@ #define CVS_GETLOG_REVEND \ "=============================================================================" -static int cvs_getlog_remote (CVSFILE *, void *); -static int cvs_getlog_local (CVSFILE *, void *); - -int cvs_getlog_options(char *, int, char **, int *); +static int cvs_getlog_remote (CVSFILE *, void *); +static int cvs_getlog_local (CVSFILE *, void *); +static int cvs_getlog_options(char *, int, char **, int *); +static int cvs_getlog_sendflags(struct cvsroot *); struct cvs_cmd_info cvs_getlog = { cvs_getlog_options, - NULL, + cvs_getlog_sendflags, cvs_getlog_remote, NULL, NULL, CF_IGNORE | CF_RECURSE, @@ -64,15 +64,18 @@ struct cvs_cmd_info cvs_getlog = { static int log_rfonly = 0; static int log_honly = 0; +static int log_lhonly = 0; static int log_notags = 0; -int +static int cvs_getlog_options(char *opt, int argc, char **argv, int *arg) { int ch; while ((ch = getopt(argc, argv, opt)) != -1) { switch (ch) { + case 'b': + break; case 'd': break; case 'h': @@ -89,6 +92,13 @@ cvs_getlog_options(char *opt, int argc, char **argv, int *arg) break; case 'r': break; + case 's': + break; + case 't': + log_lhonly = 1; + break; + case 'w': + break; default: return (CVS_EX_USAGE); } @@ -98,6 +108,20 @@ cvs_getlog_options(char *opt, int argc, char **argv, int *arg) return (0); } +static int +cvs_getlog_sendflags(struct cvsroot *root) +{ + if (log_honly && (cvs_sendarg(root, "-h", 0) < 0)) + return (CVS_EX_PROTO); + if (log_notags && (cvs_sendarg(root, "-N", 0) < 0)) + return (CVS_EX_PROTO); + if (log_rfonly && (cvs_sendarg(root, "-R", 0) < 0)) + return (CVS_EX_PROTO); + if (log_lhonly && (cvs_sendarg(root, "-t", 0) < 0)) + return (CVS_EX_PROTO); + + return (0); +} /* * cvs_getlog_remote() -- cgit v1.2.3