History

fix previous commit; make 'help' print real script name; remove another one 'basename' usage

Serge Zirukin committed 16 years ago

Commit ce132fd1 parent d49ebe51 file · +5 −5Browse files

Unified · Split

split2flac.sh+5−5
@@ -36,7 +36,7 @@ NORENAME=0 · 35 unmodified lines
3636 NOPIC=0
3737 REMOVE=0
3838 PIC_SIZE="192x192"
39−FORMAT=${0##split2}
39+FORMAT=${0##.*split2}
4040 FORMAT=${FORMAT%.sh}
4141
4242 # load settings
@@ -49,7 +49,7 @@ unset CUE · 6 unmodified lines
4949 unset CHARSET
5050 FORCE=0
5151
52−HELP="Usage: split2flac.sh [OPTIONS] FILE
52+HELP="Usage: split2\${FORMAT}.sh [OPTIONS] FILE
5353 -o DIRECTORY * - set output directory
5454 -cue FILE - use file as a cue sheet
5555 -f FORMAT - use specified output format (current is \${FORMAT})
@@ -73,7 +73,7 @@ HELP="Usage: split2flac.sh [OPTIONS] FILE · 17 unmodified lines
7373 NOTE: '-c some_file.jpg -s' only allows cover images, it doesn't set a default one.
7474 Supported FORMATs: flac, mp3, ogg."
7575
76−README="split2flac.sh splits one big APE/FLAC/WV file to FLAC/MP3/OGG tracks with tagging and renaming.
76+README="split2flac splits one big APE/FLAC/WV file to FLAC/MP3/OGG tracks with tagging and renaming.
7777 It's better to pass '-p' option to see what will happen when actually splitting tracks.
7878 You may want to pass '-s' option for the first run to save default configuration
7979 (output dir, cover image size, etc.) so you won't need to pass a lot of options
@@ -305,9 +305,9 @@ echo "Setting tags" · 225 unmodified lines
305305 i=1
306306 while [ $i -le ${TRACKS_NUM} ]; do
307307 TAG_TITLE=$(cueprint -n $i -t %t "${CUE}")
308− f="${OUT}/$(printf %02i $i).${FORMAT}"
309− FILE_TRACK=$(basename "$f" .${FORMAT})
308+ FILE_TRACK="$(printf %02i $i)"
310309 FILE_TITLE=$(echo ${TAG_TITLE} | ${VALIDATE})
310+ f="${OUT}/${FILE_TRACK}.${FORMAT}"
311311
312312 echo "$i: ${TAG_TITLE}"
313313

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t