TABLE OF CONTENTS


::pwtk::deprecatedOpts_

PURPOSE

Check for the use of deprecated options and replace them with the renamed options.

ARGUMENTS

The 'deprecatedSpecs' is the list of specs of deprecated options with the following structure:

    set deprecatedSpecs {
       {-old1 -new1}
       {-old2 -new2}
       ...
    }

where -old1 is the name of the deprecated option and -new1 is the renamed option, and so on for -old2...

SOURCE

    upvar $argsVar args

    foreach old_new $deprecatedSpecs {
        lassign $old_new old new
        if { "$old" in $args } {
            ::pwtk::deprecated "from [procName -2]: the $old command-line option is deprecated; it was replaced by the $new option"
            # substitute
            foreach ind [lsearch -all -exact $args $old] {
                set args [lreplace $args $ind $ind $new]
            }
        }
    }
}