summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/cvs.c
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-03-24 01:03:42 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-03-24 01:03:42 +0000
commit5e8d2f93a2fc7686076b1662303e6d3ce4045879 (patch)
treef9530055c8e8294a42eb8eefa7cc81685d560826 /usr.bin/cvs/cvs.c
parent22b377e7221cbc861a8913105167ff5a8de55279 (diff)
add the first pieces of our new command framework.
ok jfb@
Diffstat (limited to 'usr.bin/cvs/cvs.c')
-rw-r--r--usr.bin/cvs/cvs.c71
1 files changed, 31 insertions, 40 deletions
diff --git a/usr.bin/cvs/cvs.c b/usr.bin/cvs/cvs.c
index f8e146ad40c..2c844099ed5 100644
--- a/usr.bin/cvs/cvs.c
+++ b/usr.bin/cvs/cvs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cvs.c,v 1.42 2005/03/08 16:13:30 joris Exp $ */
+/* $OpenBSD: cvs.c,v 1.43 2005/03/24 01:03:41 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -84,36 +84,27 @@ static TAILQ_HEAD(, cvs_var) cvs_variables;
* returned is EX_USAGE, the command's usage string is printed to standard
* error before returning.
*/
-static struct cvs_cmd {
- int cmd_op;
- char cmd_name[CVS_CMD_MAXNAMELEN];
- char cmd_alias[CVS_CMD_MAXALIAS][CVS_CMD_MAXNAMELEN];
- int (*cmd_hdlr)(int, char **);
- char *cmd_synopsis;
- char *cmd_opts;
- char cmd_descr[CVS_CMD_MAXDESCRLEN];
- char *cmd_defargs;
-} cvs_cdt[] = {
+struct cvs_cmd cvs_cdt[] = {
{
CVS_OP_ADD, "add", { "ad", "new" }, cvs_add,
"[-k opt] [-m msg] file ...",
"k:m:",
"Add a new file/directory to the repository",
- NULL,
+ NULL, NULL
},
{
CVS_OP_ADMIN, "admin", { "adm", "rcs" }, cvs_admin,
"",
"",
"Administration front end for rcs",
- NULL,
+ NULL, NULL
},
{
CVS_OP_ANNOTATE, "annotate", { "ann" }, cvs_annotate,
"[-flR] [-D date | -r rev] ...",
"D:flRr:",
"Show last revision where each line was modified",
- NULL,
+ NULL, NULL
},
{
CVS_OP_CHECKOUT, "checkout", { "co", "get" }, cvs_checkout,
@@ -121,49 +112,49 @@ static struct cvs_cmd {
"[-t id] module ...",
"AcD:d:fj:k:lNnPRr:st:",
"Checkout sources for editing",
- NULL,
+ NULL, NULL
},
{
CVS_OP_COMMIT, "commit", { "ci", "com" }, cvs_commit,
"[-flR] [-F logfile | -m msg] [-r rev] ...",
"F:flm:Rr:",
"Check files into the repository",
- NULL,
+ NULL, NULL
},
{
CVS_OP_DIFF, "diff", { "di", "dif" }, cvs_diff,
"[-cilNpu] [-D date] [-r rev] ...",
"cD:ilNpr:u",
"Show differences between revisions",
- NULL,
+ NULL, NULL
},
{
CVS_OP_EDIT, "edit", { }, NULL,
"",
"",
"Get ready to edit a watched file",
- NULL,
+ NULL, NULL
},
{
CVS_OP_EDITORS, "editors", { }, NULL,
"",
"",
"See who is editing a watched file",
- NULL,
+ NULL, NULL
},
{
CVS_OP_EXPORT, "export", { "ex", "exp" }, NULL,
"",
"",
"Export sources from CVS, similar to checkout",
- NULL,
+ NULL, NULL
},
{
CVS_OP_HISTORY, "history", { "hi", "his" }, cvs_history,
"",
"",
"Show repository access history",
- NULL,
+ NULL, NULL
},
{
CVS_OP_IMPORT, "import", { "im", "imp" }, cvs_import,
@@ -171,14 +162,14 @@ static struct cvs_cmd {
"repository vendor-tag release-tags ...",
"b:dI:k:m:",
"Import sources into CVS, using vendor branches",
- NULL,
+ NULL, NULL
},
{
CVS_OP_INIT, "init", { }, cvs_init,
"",
"",
"Create a CVS repository if it doesn't exist",
- NULL,
+ NULL, NULL
},
#if defined(HAVE_KERBEROS)
{
@@ -186,7 +177,7 @@ static struct cvs_cmd {
"",
"",
"Start a Kerberos authentication CVS server",
- NULL,
+ NULL, NULL
},
#endif
{
@@ -194,84 +185,84 @@ static struct cvs_cmd {
"[-bhlNRt] [-d dates] [-r revisions] [-s states] [-w logins]",
"",
"Print out history information for files",
- NULL,
+ NULL, NULL
},
{
-1, "login", {}, NULL,
"",
"",
"Prompt for password for authenticating server",
- NULL,
+ NULL, NULL
},
{
-1, "logout", {}, NULL,
"",
"",
"Removes entry in .cvspass for remote repository",
- NULL,
+ NULL, NULL
},
{
CVS_OP_RDIFF, "rdiff", {}, NULL,
"",
"",
"Create 'patch' format diffs between releases",
- NULL,
+ NULL, NULL
},
{
CVS_OP_RELEASE, "release", {}, NULL,
"[-d]",
"d",
"Indicate that a Module is no longer in use",
- NULL,
+ NULL, NULL
},
{
CVS_OP_REMOVE, "remove", { "rm", "delete" }, cvs_remove,
"[-flR] file ...",
"flR",
"Remove an entry from the repository",
- NULL,
+ NULL, NULL
},
{
CVS_OP_RLOG, "rlog", {}, NULL,
"",
"",
"Print out history information for a module",
- NULL,
+ NULL, NULL
},
{
CVS_OP_RTAG, "rtag", {}, NULL,
"",
"",
"Add a symbolic tag to a module",
- NULL,
+ NULL, NULL
},
{
CVS_OP_SERVER, "server", {}, cvs_server,
"",
"",
"Server mode",
- NULL,
+ NULL, NULL
},
{
CVS_OP_STATUS, "status", { "st", "stat" }, cvs_status,
"[-lRv]",
"lRv",
"Display status information on checked out files",
- NULL,
+ NULL, NULL
},
{
CVS_OP_TAG, "tag", { "ta", "freeze" }, cvs_tag,
"[-bcdFflR] [-D date | -r rev] tagname",
"bcD:dFflRr:",
"Add a symbolic tag to checked out version of files",
- NULL,
+ NULL, NULL
},
{
CVS_OP_UNEDIT, "unedit", {}, NULL,
"",
"",
"Undo an edit command",
- NULL,
+ NULL, NULL
},
{
CVS_OP_UPDATE, "update", { "up", "upd" }, cvs_update,
@@ -279,27 +270,27 @@ static struct cvs_cmd {
"[-t id] ...",
"",
"Bring work tree in sync with repository",
- NULL,
+ NULL, NULL
},
{
CVS_OP_VERSION, "version", { "ve", "ver" }, cvs_version,
"", "",
"Show current CVS version(s)",
- NULL,
+ NULL, NULL
},
{
CVS_OP_WATCH, "watch", {}, NULL,
"",
"",
"Set watches",
- NULL,
+ NULL, NULL
},
{
CVS_OP_WATCHERS, "watchers", {}, NULL,
"",
"",
"See who is watching a file",
- NULL,
+ NULL, NULL
},
};