Command manipulation commands

args_parse format vars args
parses the arguments given to a command, deals with options and optional arguments
cmd_get channelId
get one complete Tcl command, in the sense of having no unclosed quotes, braces, brackets or array element names, from the open file given by channelId
cmd_split data
split data into complete Tcl commands in the sense of having no unclosed quotes, braces, brackets or array element names.
cmd_parse line
parses a cmdline. it returns a list where each element is the part of the cmdline that will result in one element when the cmdline would be evaluated. eg. % cmd_parse {set test [format "%2.2f" 4.3]} set test {[format "%2.2f" 4.3]}
cmd_load filename
returns the contents of the given file als a list of complete Tcl commands.
cmd_args cmd options vars args
parses the arguments given to a command, deals with options and optional arguments. Options are stored in the array opt, values in the variables given. the list of possible options consists of alternatingly the option and a specification, which is a list of type and description variables in the variable list enclosed in questionmarks are optional. ?...? will take all possible extra arguments at that position (if present), and store them in the variable args.
eg.:
	cmd_args test {
		-test {any "test value"}
		-b {switch "true or false"}
		-o {{oneof a b c} "a, b or c"}
	} {?a? b} {-b -test try -o b 1 2}