#
# printContainment - a procedure that prints the containment hierarchy for 
# one or more object types. 
# 
# The script init.tcl must be loaded prior to using this procedure.
#
# Arguments:
#
# objects - one or more object types whose containment hierarchies are to be printed.
#
# The init.tcl file must be loaded prior to using this procedure.
#

proc printContainment {{objects all} args} {
    global OBJECTS
    if {$objects == "all"} {set objects $OBJECTS}
    
    if {"$args" != "" } {
	foreach elem $args {
	    lappend objects $elem
	}   
    }

    foreach o $objects { 
	set cmd [concat $o containment]
	puts "# $cmd"
	set result [eval $cmd]
	puts $result
    }
}
printContainment