summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/diff.c
diff options
context:
space:
mode:
authortobias <tobias@openbsd.org>2008-03-02 19:05:34 +0000
committertobias <tobias@openbsd.org>2008-03-02 19:05:34 +0000
commitaeaaf4a6d4457144b8913fa123ca6dda7b5f2733 (patch)
tree41ef0bdd08abde4f75eea9828f78bb0e93fcb3bf /usr.bin/cvs/diff.c
parentUse a union to ensure alignment of the cmsg. (diff)
downloadwireguard-openbsd-aeaaf4a6d4457144b8913fa123ca6dda7b5f2733.tar.xz
wireguard-openbsd-aeaaf4a6d4457144b8913fa123ca6dda7b5f2733.zip
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/cvs/diff.c')
-rw-r--r--usr.bin/cvs/diff.c10
1 files changed, 7 insertions, 3 deletions
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);
}
}