Skip to content

Commit c0cb408

Browse files
authored
Merge pull request #65 from monking/speech-to-text-one-line
termux-speech-to-text: output only last line by default
2 parents 56bf789 + d3551be commit c0cb408

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

scripts/termux-speech-to-text

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,22 @@ show_usage () {
88
exit 0
99
}
1010

11-
while getopts :h option
11+
show_progress=false
12+
while getopts :hp option
1213
do
1314
case "$option" in
1415
h) show_usage;;
16+
p) show_progress=true;;
1517
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
1618
esac
1719
done
1820
shift $(($OPTIND-1))
1921

2022
if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
2123

22-
/data/data/com.termux/files/usr/libexec/termux-api SpeechToText
24+
CMD=/data/data/com.termux/files/usr/libexec/termux-api
25+
if [ $show_progress = true ]; then
26+
$CMD SpeechToText
27+
else
28+
$CMD SpeechToText | tail -1
29+
fi

0 commit comments

Comments
 (0)