proc input {message varname {default {}}} {
upvar $varname input
set input {}
puts $message
while {$input == {}} {
puts -nonewline "% "
flush stdout
gets stdin input
if {$input == {}} {set input $default}
}
puts ""
}
proc inopt {message varname} {
upvar $varname input
set input {}
puts $message
puts -nonewline "% "
flush stdout
gets stdin input
puts ""
}
proc paswd {message varname} {
upvar $varname input
set input {}
puts $message
exec stty -echo
while {$input == {}} {
puts -nonewline "% "
flush stdout
gets stdin input
}
exec stty echo
puts "\n"
}