summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-08-14 06:47:57 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-08-14 06:47:57 (GMT)
commit9e7ea957b3c08bb06ba7a98956bfc39fca90f3cb (patch)
tree96d0547b31d58987de2a0fd1bc1000aa275529bc
parent5a26579efc6ccc0229b55779c6e69acf3feccd0a (diff)
downloadtk-9e7ea957b3c08bb06ba7a98956bfc39fca90f3cb.zip
tk-9e7ea957b3c08bb06ba7a98956bfc39fca90f3cb.tar.gz
tk-9e7ea957b3c08bb06ba7a98956bfc39fca90f3cb.tar.bz2
Use "?-option" in stead of "?option" consistantly in WrongNumArgs error-messages (backported from revised_text)
-rw-r--r--generic/tkBusy.c6
-rw-r--r--generic/tkFont.c4
-rw-r--r--generic/tkPanedWindow.c2
-rw-r--r--generic/ttk/ttkTreeview.c2
-rw-r--r--tests/busy.test4
-rw-r--r--tests/font.test10
-rw-r--r--tests/textMark.test2
7 files changed, 15 insertions, 15 deletions
diff --git a/generic/tkBusy.c b/generic/tkBusy.c
index 5014eeb..8bbf764 100644
--- a/generic/tkBusy.c
+++ b/generic/tkBusy.c
@@ -819,7 +819,7 @@ Tk_BusyObjCmd(
if (Tcl_GetString(objv[1])[0] == '.') {
if (objc%2 == 1) {
- Tcl_WrongNumArgs(interp, 1, objv, "window ?option value ...?");
+ Tcl_WrongNumArgs(interp, 1, objv, "window ?-option value ...?");
return TCL_ERROR;
}
return HoldBusy(busyTablePtr, interp, objv[1], objc-2, objv+2);
@@ -865,7 +865,7 @@ Tk_BusyObjCmd(
case BUSY_CONFIGURE:
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "window ?option? ?value ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?-option? ?value ...?");
return TCL_ERROR;
}
busyPtr = GetBusy(interp, busyTablePtr, objv[2]);
@@ -922,7 +922,7 @@ Tk_BusyObjCmd(
case BUSY_HOLD:
if (objc < 3 || objc%2 != 1) {
- Tcl_WrongNumArgs(interp, 2, objv, "window ?option value ...?");
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?-option value ...?");
return TCL_ERROR;
}
return HoldBusy(busyTablePtr, interp, objv[2], objc-3, objv+3);
diff --git a/generic/tkFont.c b/generic/tkFont.c
index dbc00e4..d2aa6d2 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -556,7 +556,7 @@ Tk_FontObjCmd(
if (objc < 3 || n < objc) {
Tcl_WrongNumArgs(interp, 2, objv,
- "font ?-displayof window? ?option? ?--? ?char?");
+ "font ?-displayof window? ?-option? ?--? ?char?");
return TCL_ERROR;
}
@@ -753,7 +753,7 @@ Tk_FontObjCmd(
}
if ((objc < 3) || ((objc - skip) > 4)) {
Tcl_WrongNumArgs(interp, 2, objv,
- "font ?-displayof window? ?option?");
+ "font ?-displayof window? ?-option?");
return TCL_ERROR;
}
tkfont = Tk_AllocFontFromObj(interp, tkwin, objv[2]);
diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c
index f25726e..b1eb8c2 100644
--- a/generic/tkPanedWindow.c
+++ b/generic/tkPanedWindow.c
@@ -690,7 +690,7 @@ PanedWindowWidgetObjCmd(
case PW_PANECONFIGURE:
if (objc < 3) {
Tcl_WrongNumArgs(interp, 2, objv,
- "pane ?option? ?value option value ...?");
+ "pane ?-option? ?value -option value ...?");
result = TCL_ERROR;
break;
}
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index b484d1c..ac6107b 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -2377,7 +2377,7 @@ static int TreeviewItemCommand(
TreeItem *item;
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "item ?option ?value??...");
+ Tcl_WrongNumArgs(interp, 2, objv, "item ?-option ?value??...");
return TCL_ERROR;
}
if (!(item = FindItem(interp, tv, objv[2]))) {
diff --git a/tests/busy.test b/tests/busy.test
index 6a1263f..c743cec 100644
--- a/tests/busy.test
+++ b/tests/busy.test
@@ -21,7 +21,7 @@ test busy-1.1 {Tk_BusyObjCmd} -returnCodes error -body {
test busy-2.1 {tk busy hold} -returnCodes error -body {
tk busy hold
-} -result {wrong # args: should be "tk busy hold window ?option value ...?"}
+} -result {wrong # args: should be "tk busy hold window ?-option value ...?"}
test busy-2.2 {tk busy hold root window} -body {
set res [tk busy hold .]
update
@@ -182,7 +182,7 @@ test busy-3.7 {tk busy cget unix} -setup {
test busy-4.1 {tk busy configure no window} -returnCodes error -body {
tk busy configure
-} -result {wrong # args: should be "tk busy configure window ?option? ?value ...?"}
+} -result {wrong # args: should be "tk busy configure window ?-option? ?value ...?"}
test busy-4.2 {tk busy configure invalid window} -body {
tk busy configure .f
diff --git a/tests/font.test b/tests/font.test
index 92894d1..aa7137a 100644
--- a/tests/font.test
+++ b/tests/font.test
@@ -114,11 +114,11 @@ test font-4.1 {font command: actual: arguments} -body {
test font-4.2 {font command: actual: arguments} -body {
# (objc < 3)
font actual
-} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"}
+} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?-option? ?--? ?char?"}
test font-4.3 {font command: actual: arguments} -body {
# (objc - skip > 4) when skip == 0
font actual xyz abc def
-} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"}
+} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?-option? ?--? ?char?"}
test font-4.4 {font command: actual: displayof specified, so skip to next} -body {
catch {font actual xyz -displayof . -size}
} -result 0
@@ -128,7 +128,7 @@ test font-4.5 {font command: actual: displayof specified, so skip to next} -body
test font-4.6 {font command: actual: arguments} -body {
# (objc - skip > 4) when skip == 2
font actual xyz -displayof . abc def
-} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?option? ?--? ?char?"}
+} -returnCodes error -result {wrong # args: should be "font actual font ?-displayof window? ?-option? ?--? ?char?"}
test font-4.7 {font command: actual: arguments} -constraints noExceed -body {
# (tkfont == NULL)
font actual "\{xyz"
@@ -430,11 +430,11 @@ test font-10.2 {font command: metrics: arguments} -body {
test font-10.3 {font command: metrics: arguments} -body {
# (objc < 3)
font metrics
-} -returnCodes error -result {wrong # args: should be "font metrics font ?-displayof window? ?option?"}
+} -returnCodes error -result {wrong # args: should be "font metrics font ?-displayof window? ?-option?"}
test font-10.4 {font command: metrics: arguments} -body {
# (objc - skip) > 4) when skip == 0
font metrics xyz abc def
-} -returnCodes error -result {wrong # args: should be "font metrics font ?-displayof window? ?option?"}
+} -returnCodes error -result {wrong # args: should be "font metrics font ?-displayof window? ?-option?"}
test font-10.5 {font command: metrics: arguments} -body {
# (objc - skip) > 4) when skip == 2
font metrics xyz -displayof . abc
diff --git a/tests/textMark.test b/tests/textMark.test
index 043ff82..b4b781c 100644
--- a/tests/textMark.test
+++ b/tests/textMark.test
@@ -52,7 +52,7 @@ test textMark-1.4 {TkTextMarkCmd - "gravity" option} -body {
} -result {right 1.4}
test textMark-1.5 {TkTextMarkCmd - "gravity" option} -body {
.t mark set x 1.3
- .t mark g x left
+ .t mark gr x left
.t insert 1.3 x
list [.t mark gravity x] [.t index x]
} -result {left 1.3}