diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-05-27 20:47:07 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-05-27 20:47:07 +0000 |
commit | e8cf86f62186a86545204fc9b8bf7b42d95b9d4a (patch) | |
tree | a9343b18d66e6743a0677be68337ef32589b7cd8 /usr.bin/cvs/history.c | |
parent | 422d1a1e834f32d2a13e2c9c12a3da66839443a9 (diff) |
- add missing options
- correctly handle -a and -u flags
ok joris jfbeers
Diffstat (limited to 'usr.bin/cvs/history.c')
-rw-r--r-- | usr.bin/cvs/history.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/usr.bin/cvs/history.c b/usr.bin/cvs/history.c index 87c7df6985c..2f9201b14e5 100644 --- a/usr.bin/cvs/history.c +++ b/usr.bin/cvs/history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: history.c,v 1.14 2005/05/24 04:12:25 jfb Exp $ */ +/* $OpenBSD: history.c,v 1.15 2005/05/27 20:47:06 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -63,8 +63,9 @@ struct cvs_cmd cvs_cmd_history = { CVS_OP_HISTORY, CVS_REQ_HISTORY, "history", { "hi", "his" }, "Show repository access history", - "", - "acelm:oTt:u:wx:z:", + "[-aceloTw] [-b str] [-D date] [-f file] [-m module] [-n module] " + "[-p path] [-r rev] [-t tag] [-u user] [-x ACEFGMORTUW] [-z tz]", + "ab:cD:ef:lm:n:op:r:Tt:u:wx:z:", NULL, 0, cvs_history_init, @@ -94,14 +95,20 @@ cvs_history_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) case 'a': flags |= CVS_HF_A; break; + case 'b': + break; case 'c': rep++; flags |= CVS_HF_C; break; + case 'D': + break; case 'e': rep++; flags |= CVS_HF_E; break; + case 'f': + break; case 'l': flags |= CVS_HF_L; break; @@ -114,6 +121,8 @@ cvs_history_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) } modules[nbmod++] = optarg; break; + case 'n': + break; case 'o': rep++; flags |= CVS_HF_O; @@ -156,6 +165,8 @@ cvs_history_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) static int cvs_history_pre_exec(struct cvsroot *root) { + if ((flags & CVS_HF_A) && (cvs_sendarg(root, "-a", 0) < 0)) + return (CVS_EX_PROTO); if ((flags & CVS_HF_C) && (cvs_sendarg(root, "-c", 0) < 0)) return (CVS_EX_PROTO); @@ -169,11 +180,17 @@ cvs_history_pre_exec(struct cvsroot *root) return (CVS_EX_PROTO); } - if (user != NULL) { + /* if no user is specified, get login name of command issuer */ + if (!(flags & CVS_HF_A) && (user == NULL)) { + if ((user = getlogin()) == NULL) { + cvs_log(LP_ERRNO, "cannot get login name"); + return (CVS_EX_DATA); + } + } + if (!(flags & CVS_HF_A)) if ((cvs_sendarg(root, "-u", 0) < 0) || (cvs_sendarg(root, user, 0) < 0)) return (CVS_EX_PROTO); - } if ((cvs_sendarg(root, "-z", 0) < 0) || (cvs_sendarg(root, zone, 0) < 0)) |