diff options
author | Niall O'Higgins <niallo@cvs.openbsd.org> | 2005-10-10 15:05:49 +0000 |
---|---|---|
committer | Niall O'Higgins <niallo@cvs.openbsd.org> | 2005-10-10 15:05:49 +0000 |
commit | 88dce1a68047517130248e72853b141bc903f843 (patch) | |
tree | cce616b699fb0d86db409acdc17067ea4a602268 /usr.bin | |
parent | 6a1908424a714e762ceb2cde7a814d894bc80dd0 (diff) |
- support <rev> parameter to `-l' and `-u' options.
- sync checkin_usage().
note that with OpenRCS you must do `ci -l -- <file>' and `ci -u -- <file>'
when using bare arguments because our getopt(3) is POSIX compliant.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rcs/ci.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c index b00dd004e44..da7e5c3c286 100644 --- a/usr.bin/rcs/ci.c +++ b/usr.bin/rcs/ci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.17 2005/10/10 14:49:32 niallo Exp $ */ +/* $OpenBSD: ci.c,v 1.18 2005/10/10 15:05:48 niallo Exp $ */ /* * Copyright (c) 2005 Niall O'Higgins <niallo@openbsd.org> * All rights reserved. @@ -56,8 +56,8 @@ void checkin_usage(void) { fprintf(stderr, - "usage: %s [-jlMNquV] [-d date] [-r [rev]] [-m msg] [-k mode] " - "file ...\n", __progname); + "usage: %s [-jMNqV] [-d date] [-k mode] [-l [rev]] [-m msg]\n" + " [-r [rev]] [-u [rev]] file ...\n", __progname); } /* @@ -90,7 +90,7 @@ checkin_main(int argc, char **argv) exit(1); } - while ((ch = getopt(argc, argv, "j:lM:N:qud:r::m:k:V")) != -1) { + while ((ch = getopt(argc, argv, "j:l::M:N:qu::d:r::m:k:V")) != -1) { switch (ch) { case 'h': (usage)(); @@ -106,9 +106,21 @@ checkin_main(int argc, char **argv) printf("%s\n", rcs_version); exit(0); case 'l': + if (optarg != NULL) { + if ((newrev = rcsnum_parse(optarg)) == NULL) { + cvs_log(LP_ERR, "bad revision number"); + exit(1); + } + } lkmode = LOCK_LOCK; break; case 'u': + if (optarg != NULL) { + if ((newrev = rcsnum_parse(optarg)) == NULL) { + cvs_log(LP_ERR, "bad revision number"); + exit(1); + } + } lkmode = LOCK_UNLOCK; break; case 'r': |