1
Fork 0

Add the 'lor' formatter to paste the schedule on LOR. The 'term' formatter is slightly modified.

master
vonavi 2014-03-27 13:26:01 +02:00
parent e0e58d1b7a
commit 7f76921cb3
1 changed files with 15 additions and 2 deletions

View File

@ -106,10 +106,10 @@ show_tour_info() {
}
info_output_term() {
echo -n "$(tput setaf 2)Тур ${tour_num} "
echo -n "$(tput setaf 2)${tour_num} тур "
echo "$(tput setaf 6)(${date_beg} - ${date_end})$(tput sgr0)"
echo -e "$1" | column -t | while IFS= read line; do
echo -en "$1" | column -t | while IFS= read line; do
# Highlight player's name
if [[ -n "$PLAYER" ]]; then
players=$(grep -o "[^ ]*${PLAYER}[^ ]*" <<< "$line")
@ -127,6 +127,19 @@ info_output_term() {
echo
}
info_output_lor() {
echo "[u][b]${tour_num} тур (${date_beg} - ${date_end})[/b][/u]"
echo "[list]"
echo -en "$1" | while read white black result; do
echo " [*][user]${white}[/user] - [user]${black}[/user] ${result}"
done
echo "[/list]"
echo
}
# Note that we use '"$@"' to let each command-line parameter expand to a
# separate word. The quotes around '$@' are essential!
# We need 'opts' as the 'eval set --' would nuke the return value of getopt