You've already forked macports-base
mirror of
https://github.com/macports/macports-base.git
synced 2026-07-12 18:18:43 -07:00
Add default procedure to make defining default values easier
git-svn-id: https://svn.macports.org/repository/macports/trunk/base@25 d073be05-634f-4543-b044-5fe20cf6d1d6
This commit is contained in:
@@ -38,6 +38,15 @@ proc options {array args} {
|
||||
}
|
||||
}
|
||||
|
||||
# default
|
||||
# Checks if variable is set, if not, sets to supplied value
|
||||
proc default {array key val} {
|
||||
upvar $array uparray
|
||||
if {![isval $array $key]} {
|
||||
setval $array $key $val
|
||||
}
|
||||
}
|
||||
|
||||
# globals
|
||||
# Specifies which keys from an array should be exported as global variables.
|
||||
# Often used directly with options procedure
|
||||
|
||||
Reference in New Issue
Block a user