diff options
author | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2005-05-24 04:12:26 +0000 |
---|---|---|
committer | Jean-Francois Brousseau <jfb@cvs.openbsd.org> | 2005-05-24 04:12:26 +0000 |
commit | e87333a6ae634b7bf229d48ef588b1d14f02dfd9 (patch) | |
tree | 396538c572f6c7daddebc26b58e9a8d17572caef /usr.bin/cvs/release.c | |
parent | 686088575a6a7d8fbc8bd29e3bd4b823134d7c22 (diff) |
Merge the cvs_cmd and cvs_cmd_info structures and add the necessary
fields to hook local versions of the commands. This needs to go in
before it gets any bigger
ok joris
Diffstat (limited to 'usr.bin/cvs/release.c')
-rw-r--r-- | usr.bin/cvs/release.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/usr.bin/cvs/release.c b/usr.bin/cvs/release.c index ce6ee75b0ef..d1a39c034f8 100644 --- a/usr.bin/cvs/release.c +++ b/usr.bin/cvs/release.c @@ -1,4 +1,4 @@ -/* $OpenBSD: release.c,v 1.6 2005/05/20 20:00:53 joris Exp $ */ +/* $OpenBSD: release.c,v 1.7 2005/05/24 04:12:25 jfb Exp $ */ /* * Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org> * All rights reserved. @@ -42,29 +42,36 @@ extern char *__progname; -static int cvs_release_options(char *, int, char **, int *); -static int cvs_release_sendflags(struct cvsroot *); -static int cvs_release_yesno(void); -static int cvs_release_dir(CVSFILE *, void *); - -struct cvs_cmd_info cvs_release = { - cvs_release_options, - cvs_release_sendflags, +static int cvs_release_init (struct cvs_cmd *, int, char **, int *); +static int cvs_release_pre_exec (struct cvsroot *); +static int cvs_release_yesno (void); +static int cvs_release_dir (CVSFILE *, void *); + +struct cvs_cmd cvs_cmd_release = { + CVS_OP_RELEASE, CVS_REQ_RELEASE, "release", + { }, + "Release", + "[-d]", + "d", + NULL, + 0, + cvs_release_init, + cvs_release_pre_exec, + cvs_release_dir, cvs_release_dir, - NULL, NULL, - CF_IGNORE | CF_KNOWN | CF_NOFILES | CF_RECURSE, - CVS_REQ_RELEASE, + NULL, + NULL, CVS_CMD_SENDDIR | CVS_CMD_SENDARGS2 | CVS_CMD_ALLOWSPEC }; static int dflag; /* -d option */ static int -cvs_release_options(char *opt, int argc, char **argv, int *arg) +cvs_release_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) { int ch; - while ((ch = getopt(argc, argv, opt)) != -1) { + while ((ch = getopt(argc, argv, cmd->cmd_opts)) != -1) { switch (ch) { case 'd': dflag = 1; @@ -85,7 +92,7 @@ cvs_release_options(char *opt, int argc, char **argv, int *arg) } static int -cvs_release_sendflags(struct cvsroot *root) +cvs_release_pre_exec(struct cvsroot *root) { if (dflag && cvs_sendarg(root, "-d", 0) < 0) return (CVS_EX_PROTO); |