|
|
To support network operations, the manager accepts a single
command line argument: the host name.
The managed host name is used in OSA object calls
to access data or perform operations on the remote host.
getopt(3tlib)
is used to parse command line options of UNIX utilities.
Template procedure: ParseCommandLine
proc ParseCommandLine {} { global argv argc opterr optind appvals# scan for commandline flags set optString "" set argc [llength $argv] set opterr 0 while {[set opt [getopt $argc $argv $optString]] != -1} { switch $opt { {?} { Usage; Exit 1 } } }
# process commandline arguments set optCount [expr "$argc - $optind"]
# take managed host name as a command line argument if {$appvals(openhost)} { if {$optCount} { set appvals(managedhost) [lindex $argv $optind] incr optCount -1 } }
if {$optCount > 0} { Usage; Exit 1 } }
See also: