gml_OptionParser.tcl File Reference

gmlOptionParser_parse optionDescrList string resVarName { setDefaults 1 } { errorOnUnknown 1 }

Parse a string that contains "-option value" couples. Return the list of couples that were not parsed. This list may be non empty only if errorOnUnknown is false.

optionDescrList
is the list of accepted options with their default values. For example: "-color blue -children {}"
string
the string of "-option value" couples to parse.
resVarName
if not empty, the name of the array variable that stores the result of the parsing. If empty, the option parser object itself is used.
setDefaults
if true, options that are not defined in string are defined in the result array with default values.
errorOnUnknown
if true, an error is generated if an unknown option is found in string. Otherwise, the unkown option and its value are ignored.