Skip to content

Commit 7221568

Browse files
committed
Adding cache purging feature, help message, and version printing option
1 parent fad73a5 commit 7221568

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

pronounce

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
PRONOUNCE_VERSION="1.1.0"
4+
35
echo -e "\e[0;32m"
46
echo "The pronounce: Frontend for English Words Pronunciation"
57
echo "Copyright © 2013 Behnam Momeni"
@@ -73,7 +75,22 @@ function run_external_program {
7375

7476
}
7577

76-
if [ "a$2" = "a" ]; then
78+
if [ "$1" = "-h" ]; then
79+
echo -e "Usage: \e[1;33m"
80+
echo -e "\t<word> Plays 1st pronunciation of <word>"
81+
echo -e "\t<word> <num> Plays <num>-th pronunciation of <word>"
82+
echo -e "\t<word> f Opens definition page of <word> in Mozilla Firefox"
83+
echo -e "\t<word> w Opens definition page of <word> in w3m command line browser"
84+
echo -e "\t-c Purges the local audio files cache (rm -f)"
85+
echo -e "\t-v Prints version"
86+
echo -e "\t-h Prints this message"
87+
echo -e "\e[0m"
88+
elif [ "$1" = "-c" ]; then
89+
echo "Purging the cache"
90+
rm -f ~/pronunciation.wavs/*
91+
elif [ "$1" = "-v" ]; then
92+
echo "Version: $PRONOUNCE_VERSION"
93+
elif [ "a$2" = "a" ]; then
7794
main $1 1
7895
elif [ "$2" = "f" ]; then
7996
run_external_program firefox "http://www.merriam-webster.com/dictionary/$1#headword"

0 commit comments

Comments
 (0)