From 62fe6b8b456bd7c18d0b24e9d4bf2ed62c5d7d0b Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 28 Dec 2010 22:14:37 +0100 Subject: stream: added verbose /help --- modules/stream | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/stream b/modules/stream index 76e86317..fa5a2d6e 100755 --- a/modules/stream +++ b/modules/stream @@ -2,7 +2,20 @@ inputdir=$HOME/noise/streams case "$1" in (--help) - echo "play an audio stream" ;; + if echo "$0 $*" | grep -q '[[:space:]]--verbose\>'; then + echo -e "\x1B[35mtype \x1B[32m/espeak off \x1B[35mto turn stream off\x1B[m" + for i in `ls $inputdir` ; do + filename="$inputdir/$i" + shortcut=`xmlstarlet sel -t -v /station/@shortcut "$inputdir/$i"` + title=`xmlstarlet sel -t -v /station/@title "$inputdir/$i"` + topic=`xmlstarlet sel -t -v /station/@topic "$inputdir/$i"` + stream=`xmlstarlet sel -t -v /station/@stream "$inputdir/$i"` + echo -e "\x1B[35mtype \x1B[32m/espeak $shortcut \x1B[35mfor $topic\x1B[m" + done + else + echo "play an audio stream" + fi + ;; (*) exec 2>&1 ffs='xml' -- cgit v1.2.3