beetlebug▾
/

tcl::OptProc OptKeyError

Gives an error with a text and the table of the items of a description.

tcl::OptKeyError PREFIX KEY

Description

Gives an error whose message is PREFIX, a newline, and the table of the items of the description of KEY, as a bad call of a proc of tcl::OptProc gives it.

Arguments

ArgumentTypeDefaultDescription
PREFIXstringrequiredThe first line of the message.
KEYstringrequiredA key of tcl::OptKeyRegister.

Returns

No result: the command always gives an error.

Examples

Each example of this page runs after package require opt.

% tcl::OptKeyRegister {{x -int 0 "x"}} k3
> catch {tcl::OptKeyError "bad call:" k3} m
> lindex [split $m \n] 0
bad call:

Errors

% tcl::OptKeyRegister {{x -int 0 "x"}} k3
> tcl::OptKeyError "bad call:" k3
bad call:
    Var/FlagName Type Value Help
    ------------ ---- ----- ----
    (-help                  gives this help)
    x            int  (0)   x
-errorcode NONE

Facts

Capability
package. A new interpreter does not have it until the host turns it on.
Tcl release
Tcl 9.1 and 8.6.
Since
ztcl 1.0.0-beta.1

See also