summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-05-07 21:15:43 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-05-07 21:15:43 (GMT)
commit3b3fd58326def069be2ac1b8aab26a9d875aa237 (patch)
treeef4a6196a9098acb617cbec70c0b2a10a0874bbe /generic
parentc9ca13a50c7725c87968a8ce5e2053d23b5bd5cf (diff)
downloadtcl-3b3fd58326def069be2ac1b8aab26a9d875aa237.zip
tcl-3b3fd58326def069be2ac1b8aab26a9d875aa237.tar.gz
tcl-3b3fd58326def069be2ac1b8aab26a9d875aa237.tar.bz2
Made error message for [trace info] more consistent with documentation.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCmdMZ.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 3e9d8d0..079ef15 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdMZ.c,v 1.87 2003/05/05 20:54:38 dgp Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.88 2003/05/07 21:15:44 dkf Exp $
*/
#include "tclInt.h"
@@ -2882,8 +2882,7 @@ Tcl_TraceObjCmd(dummy, interp, objc, objv)
}
switch ((enum traceOptions) optionIndex) {
case TRACE_ADD:
- case TRACE_REMOVE:
- case TRACE_INFO: {
+ case TRACE_REMOVE: {
/*
* All sub commands of trace add/remove must take at least
* one more argument. Beyond that we let the subcommand itself
@@ -2901,6 +2900,29 @@ Tcl_TraceObjCmd(dummy, interp, objc, objv)
return (traceSubCmds[typeIndex])(interp, optionIndex, objc, objv);
break;
}
+ case TRACE_INFO: {
+ /*
+ * All sub commands of trace info must take exactly two
+ * more arguments which name the type of thing being
+ * traced and the name of the thing being traced.
+ */
+ int typeIndex;
+ if (objc < 3) {
+ /*
+ * Delegate other complaints to the type-specific code
+ * which can give a better error message.
+ */
+ Tcl_WrongNumArgs(interp, 2, objv, "type name");
+ return TCL_ERROR;
+ }
+ if (Tcl_GetIndexFromObj(interp, objv[2], traceTypeOptions,
+ "option", 0, &typeIndex) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ return (traceSubCmds[typeIndex])(interp, optionIndex, objc, objv);
+ break;
+ }
+
#ifndef TCL_REMOVE_OBSOLETE_TRACES
case TRACE_OLD_VARIABLE: {
int flags;