run: support variable arguments in append_if
This enables to use append_if like the append command in the following
situation.
proc optional_binary {} {...}
append_if $optional config {
<start name="} [optional_binary] {">
...
}
This commit is contained in:
@@ -72,9 +72,9 @@ proc create_boot_directory { } {
|
||||
##
|
||||
# Append string to variable only if 'condition' is satisfied
|
||||
#
|
||||
proc append_if {condition var string} {
|
||||
proc append_if {condition var args} {
|
||||
upvar $var up_var
|
||||
if {$condition} { append up_var $string }
|
||||
if {$condition} { append up_var [join $args ""] }
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user