# TWAPI example # Show the services that depend on the specified service # Usage example: tclsh showservicedependents.example SERVICENAME package require twapi if {$argc != 1} { puts stderr "Usage: [info nameofexecutable] $argv0 SERVICENAME" exit 1 } # Convert the service name to the internal name set svcname [twapi::get_service_internal_name [lindex $argv 0]] set services [list ] foreach svc [twapi::get_dependent_service_status $svcname] { # Convert the keylist for each service to an array ... array set svcinfo $svc # ... and pick out the service display name lappend services $svcinfo(display_name) } puts [join [lsort -dictionary $services] \n]