Skip to content

Commit

Permalink
Adding cache purging feature, help message, and version printing option
Browse files Browse the repository at this point in the history
  • Loading branch information
momeni committed Sep 17, 2013
1 parent fad73a5 commit 7221568
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion pronounce
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

PRONOUNCE_VERSION="1.1.0"

echo -e "\e[0;32m"
echo "The pronounce: Frontend for English Words Pronunciation"
echo "Copyright © 2013 Behnam Momeni"
Expand Down Expand Up @@ -73,7 +75,22 @@ function run_external_program {

}

if [ "a$2" = "a" ]; then
if [ "$1" = "-h" ]; then
echo -e "Usage: \e[1;33m"
echo -e "\t<word> Plays 1st pronunciation of <word>"
echo -e "\t<word> <num> Plays <num>-th pronunciation of <word>"
echo -e "\t<word> f Opens definition page of <word> in Mozilla Firefox"
echo -e "\t<word> w Opens definition page of <word> in w3m command line browser"
echo -e "\t-c Purges the local audio files cache (rm -f)"
echo -e "\t-v Prints version"
echo -e "\t-h Prints this message"
echo -e "\e[0m"
elif [ "$1" = "-c" ]; then
echo "Purging the cache"
rm -f ~/pronunciation.wavs/*
elif [ "$1" = "-v" ]; then
echo "Version: $PRONOUNCE_VERSION"
elif [ "a$2" = "a" ]; then
main $1 1
elif [ "$2" = "f" ]; then
run_external_program firefox "http://www.merriam-webster.com/dictionary/$1#headword"
Expand Down

0 comments on commit 7221568

Please sign in to comment.