Mercurial > hg > egg-tcls
comparison weather.tcl @ 203:28ee3578a6d1
Weather: Add support for usage messages without default prefix.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 18 Jun 2014 21:02:46 +0300 |
parents | 92f4a489b7ef |
children | f56c598be862 |
comparison
equal
deleted
inserted
replaced
201:92f4a489b7ef | 203:28ee3578a6d1 |
---|---|
100 | 100 |
101 proc weather_usage {apublic anick achan amsg} { | 101 proc weather_usage {apublic anick achan amsg} { |
102 global weather_msg_usage_prefix_1 weather_msg_usage_prefix_2 | 102 global weather_msg_usage_prefix_1 weather_msg_usage_prefix_2 |
103 set nline 0 | 103 set nline 0 |
104 foreach aline [split $amsg "\n"] { | 104 foreach aline [split $amsg "\n"] { |
105 if {$nline == 0} { | 105 if {[string range $aline 0 1] == ":"} { |
106 weather_msg_do $apublic $anick $achan $aline | |
107 } elseif {$nline == 0} { | |
106 weather_msg_do $apublic $anick $achan "$weather_msg_usage_prefix_1$aline" | 108 weather_msg_do $apublic $anick $achan "$weather_msg_usage_prefix_1$aline" |
107 } else { | 109 } else { |
108 weather_msg_do $apublic $anick $achan "$weather_msg_usage_prefix_2$aline" | 110 weather_msg_do $apublic $anick $achan "$weather_msg_usage_prefix_2$aline" |
109 } | 111 } |
110 incr nline | 112 incr nline |