summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2008-03-02 19:05:35 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2008-03-02 19:05:35 +0000
commit21e57644f109038267df3af8ab18fa811d50a066 (patch)
tree262078a3ea0d40a4cb96511a671cee2e7d696428 /usr.bin
parent64f42324d4b2d47a308a0a4aaeb357ff22dfec34 (diff)
Print the right synopsis for commands on error (especially if commands
share the same function: (r)tag, etc.). ok joris
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/annotate.c6
-rw-r--r--usr.bin/cvs/diff.c10
-rw-r--r--usr.bin/cvs/getlog.c6
-rw-r--r--usr.bin/cvs/tag.c6
-rw-r--r--usr.bin/cvs/update.c4
5 files changed, 21 insertions, 11 deletions
diff --git a/usr.bin/cvs/annotate.c b/usr.bin/cvs/annotate.c
index 935ef87c6e2..129eda59c18 100644
--- a/usr.bin/cvs/annotate.c
+++ b/usr.bin/cvs/annotate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: annotate.c,v 1.55 2008/02/10 10:21:42 joris Exp $ */
+/* $OpenBSD: annotate.c,v 1.56 2008/03/02 19:05:34 tobias Exp $ */
/*
* Copyright (c) 2007 Tobias Stoeckmann <tobias@openbsd.org>
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -84,7 +84,9 @@ cvs_annotate(int argc, char **argv)
cvs_specified_tag = optarg;
break;
default:
- fatal("%s", cvs_cmd_annotate.cmd_synopsis);
+ fatal("%s", cvs_cmdop == CVS_OP_ANNOTATE ?
+ cvs_cmd_annotate.cmd_synopsis :
+ cvs_cmd_rannotate.cmd_synopsis);
}
}
diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c
index 6d6eea4d087..21a84a0187a 100644
--- a/usr.bin/cvs/diff.c
+++ b/usr.bin/cvs/diff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.c,v 1.132 2008/03/01 21:29:36 deraadt Exp $ */
+/* $OpenBSD: diff.c,v 1.133 2008/03/02 19:05:34 tobias Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -89,7 +89,9 @@ cvs_diff(int argc, char **argv)
if (RCS_KWEXP_INVAL(kflag)) {
cvs_log(LP_ERR,
"invalid RCS keyword expension mode");
- fatal("%s", cvs_cmd_add.cmd_synopsis);
+ fatal("%s", cvs_cmdop == CVS_OP_DIFF ?
+ cvs_cmd_diff.cmd_synopsis :
+ cvs_cmd_rdiff.cmd_synopsis);
}
break;
case 'l':
@@ -127,7 +129,9 @@ cvs_diff(int argc, char **argv)
fatal("the -V option is obsolete "
"and should not be used");
default:
- fatal("%s", cvs_cmd_diff.cmd_synopsis);
+ fatal("%s", cvs_cmdop == CVS_OP_DIFF ?
+ cvs_cmd_diff.cmd_synopsis :
+ cvs_cmd_rdiff.cmd_synopsis);
}
}
diff --git a/usr.bin/cvs/getlog.c b/usr.bin/cvs/getlog.c
index f65a107e2d6..fe8957098eb 100644
--- a/usr.bin/cvs/getlog.c
+++ b/usr.bin/cvs/getlog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getlog.c,v 1.86 2008/02/09 14:25:02 joris Exp $ */
+/* $OpenBSD: getlog.c,v 1.87 2008/03/02 19:05:34 tobias Exp $ */
/*
* Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org>
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
@@ -98,7 +98,9 @@ cvs_getlog(int argc, char **argv)
wlist = optarg;
break;
default:
- fatal("%s", cvs_cmd_log.cmd_synopsis);
+ fatal("%s", cvs_cmdop == CVS_OP_LOG ?
+ cvs_cmd_log.cmd_synopsis :
+ cvs_cmd_rlog.cmd_synopsis);
}
}
diff --git a/usr.bin/cvs/tag.c b/usr.bin/cvs/tag.c
index 6db487fa5ce..0e3bbf0540f 100644
--- a/usr.bin/cvs/tag.c
+++ b/usr.bin/cvs/tag.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tag.c,v 1.69 2008/03/01 21:29:37 deraadt Exp $ */
+/* $OpenBSD: tag.c,v 1.70 2008/03/02 19:05:34 tobias Exp $ */
/*
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
*
@@ -95,7 +95,9 @@ cvs_tag(int argc, char **argv)
tag_oldname = optarg;
break;
default:
- fatal("%s", cvs_cmd_tag.cmd_synopsis);
+ fatal("%s", cvs_cmdop == CVS_OP_TAG ?
+ cvs_cmd_tag.cmd_synopsis :
+ cvs_cmd_rtag.cmd_synopsis);
}
}
diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c
index c7c704a572f..7e65d7a38c9 100644
--- a/usr.bin/cvs/update.c
+++ b/usr.bin/cvs/update.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: update.c,v 1.134 2008/03/01 22:35:44 joris Exp $ */
+/* $OpenBSD: update.c,v 1.135 2008/03/02 19:05:34 tobias Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -91,7 +91,7 @@ cvs_update(int argc, char **argv)
if (RCS_KWEXP_INVAL(kflag)) {
cvs_log(LP_ERR,
"invalid RCS keyword expension mode");
- fatal("%s", cvs_cmd_add.cmd_synopsis);
+ fatal("%s", cvs_cmd_update.cmd_synopsis);
}
break;
case 'l':