Ask if the user wants to confirm all files.
Pressing `y' on all those files might be annoying.
This commit is contained in:
parent
eb170a08f9
commit
6a75f0aa71
@ -2,10 +2,26 @@
|
||||
# Copyright (c) 2016 Nicolás A. Ortega
|
||||
# License: GNU GPLv3
|
||||
|
||||
while true
|
||||
do
|
||||
read -p "Should Ogg-Converter confirm each conversion? (y/n)" ANSWER
|
||||
case $ANSWER in
|
||||
[yY]* ) CONFIRMATION=true
|
||||
break;;
|
||||
|
||||
[nN]* ) CONFIRMATION=false
|
||||
break;;
|
||||
|
||||
* ) echo "Please enter a valid option."
|
||||
esac
|
||||
done
|
||||
|
||||
for f in $@
|
||||
do
|
||||
OUTFILE=${f:0:-4}
|
||||
echo "Convert $f to $OUTFILE.ogg"
|
||||
if $CONFIRMATION
|
||||
then
|
||||
while true
|
||||
do
|
||||
read -p "Do you wish to continue? (y/n) " ANSWER
|
||||
@ -19,4 +35,7 @@ do
|
||||
* ) echo "Please enter a valid option."
|
||||
esac
|
||||
done
|
||||
else
|
||||
ffmpeg -loglevel warning -i $f $OUTFILE.ogg
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user