Skip to content

Commit d3551be

Browse files
committed
termux-speech-to-text: output only last line by default
-p option to print all lines, as before
1 parent 6c92f85 commit d3551be

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)