diff options
author | Case Duckworth | 2023-03-05 21:37:10 -0600 |
---|---|---|
committer | Case Duckworth | 2023-03-05 21:37:10 -0600 |
commit | 746aa1743096e166341de7ec226ae0c656d47240 (patch) | |
tree | abf551cfa3e46e7297d48824bb3afbf5180318e3 | |
parent | Remove spurious echo (diff) | |
download | twerk-746aa1743096e166341de7ec226ae0c656d47240.tar.gz twerk-746aa1743096e166341de7ec226ae0c656d47240.zip |
Display @'s better
-rwxr-xr-x | twerk | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/twerk b/twerk index 163790a..02bd631 100755 --- a/twerk +++ b/twerk | |||
@@ -174,6 +174,27 @@ format_posts() { | |||
174 | tr ' ' '\n' | | 174 | tr ' ' '\n' | |
175 | while IFS= read word | 175 | while IFS= read word |
176 | do | 176 | do |
177 | case "$word" in | ||
178 | \@\<*\>) | ||
179 | word="${word#@<}" | ||
180 | word="${word%>}" | ||
181 | word="[35m@${word}[0m" | ||
182 | ;; | ||
183 | \@\<*) | ||
184 | read nextword | ||
185 | case "$nextword" in | ||
186 | *\>) | ||
187 | word="${word#@<}" | ||
188 | word="[35m@${word}[0m" | ||
189 | ;; | ||
190 | *) | ||
191 | word="$word $nextword" | ||
192 | ;; | ||
193 | esac | ||
194 | ;; | ||
195 | esac | ||
196 | |||
197 | |||
177 | if test $(( linewidth + ${#word} )) -ge "$TWERK_WIDTH" | 198 | if test $(( linewidth + ${#word} )) -ge "$TWERK_WIDTH" |
178 | then | 199 | then |
179 | echo | 200 | echo |