TABLE OF CONTENTS
::pwtk::deleteOpts_
SYNOPSIS
proc ::pwtk::deleteOpts_ {optionsVar usageVar args} {
DESCRIPTION
Delete options from 'optionsVar' and 'usageVar'.
ARGUMENTS
- optionsVar --- name of the 'options' variable
- usageVar --- name of the 'usage' variable
- args --- options to delete
SOURCE
upvar $optionsVar options upvar $usageVar usage set aux_options $options set aux_usage $usage foreach opt $args { set new_options {} set new_usage {} set opt [string trim $opt -] foreach optSpec $aux_options { lassign $optSpec thisOpt if { ! ($opt eq $thisOpt || "$opt.arg" eq $thisOpt) } { lappend new_options $optSpec } } # plain list variant foreach usageSpec $aux_usage { lassign $usageSpec thisOpt if { $thisOpt ne "-$opt" } { lappend new_usage $usageSpec } } set aux_options $new_options set aux_usage $new_usage } set options $new_options set usage $new_usage }