|
NAME::clig::Int - declare an option with parameters of type int SYNOPSISpackage require clig namespace import ::clig::* setSpec db Int -opt varname usage [-c min max] {[-d default ...] | [-m]} [-r rmin rmax] DESCRIPTIONThe Int command declares -opt to have zero or more integer arguments. The parameters variable and usage as well as the options -c, -d and -m are described in clig::String(n).
WARNING: The implementation of option -d is currently incomplete insofar, as the specified default values are not checked by clig, i.e. the following would go unnoticed: -d 1.0 -r 500 600
In this case, if option is not on the command line, the clig parser will set variable varname for its caller to the out-of-range value 1.0. (Maybe this is a feature?) Example use of Int: Int -ind indices {list of indices to use} \
PARSER RESULTtclWithin a Tcl-script, the parser will set the variable with name varname in the stack-frame of its caller if and only if option -opt is found on the command line or has a default value. CThe structure returned by the parser contains the slots varnameP, varname and varnameC. The slot varnameP will be set to a non-zero value, if and only if the option -opt is found on the command line or has a default value. Otherwise it will be 0. The slot varnameC will be set to the number of arguments found for -opt. If the number of arguments for -opt is allowed to be greater than 1, slot varname has type int*, otherwise it has type int. SEE ALSOclig_Rest(n), clig_Flag(n), clig_Double(n), clig_Float(n), clig_Version(n), clig_Usage(n), clig_Name(n), clig_parseCmdline(n), clig_Long(n), clig_String(n), clig_Commandline(n), clig(1), clig_Description(n)
|