Commit 7fff46c5 authored by Cédric Marie's avatar Cédric Marie

mycdrip: Add -w and -f options to split actions

Add options to separate extraction and conversion, in case you have to
extract on a specific computer (with a CD drive that is able to read
your CD!), but would rather convert on the other computer (with a more
recent version of flac package for example).

Option -w will only extract to .wav files.
Option -f will only convert .wav files to .flac files (and rename
them).
Signed-off-by: default avatarCédric Marie <cedric@hjuvi.lautre.net>
parent 5b21aaae
......@@ -21,6 +21,9 @@ print_usage()
printf "Prefix the filenames with DISCNUMBER if set.\n\n"
printf "Options:\n"
printf " -h display this message\n"
printf " -w only extract .wav files (step 1)\n"
printf " -f only convert .wav files to .flac (steps 2 and 3)\n"
printf " (Options w and f are mutually exclusive)\n"
}
print_header()
......@@ -28,18 +31,28 @@ print_header()
printf "\n\033[1;32m$1\033[0m\n"
}
option_wav=0
option_flac=0
# Get options from command line
while getopts h OPT
while getopts hwf OPT
do
case $OPT in
h) print_usage; exit 0;;
w) option_wav=1;;
f) option_flac=1;;
*) print_usage; exit 1;;
esac
done
shift $(($OPTIND - 1))
print_header "Step 1: Extract to .wav files"
cdparanoia --batch --never-skip
[ $option_wav -eq 1 -a $option_flac -eq 1 ] && print_usage && exit 1
if [ $option_flac -eq 0 ]; then
print_header "Step 1: Extract to .wav files"
cdparanoia --batch --never-skip
fi
[ $option_wav -eq 1 ] && exit 0
print_header "Step 2: Convert to .flac files"
flac --delete-input-file --no-seektable *.wav
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment