@@ -12,8 +12,8 @@ FLAC_LEVEL=5 # Default FLAC compression level
1212PRESERVE_MODTIME=" " # for -p|--preserve
1313
1414SELF=" $( readlink -f " $0 " ) "
15- OPTS=$( getopt -o Vvhrnps012345678 \
16- -l version,verbose ,help,recursive,preserve, no-action,no-sync,fast,best \
15+ OPTS=$( getopt -o 012345678hnprsvV \
16+ -l best,fast ,help,no-action,no-sync,preserve,recursive,verbose,version \
1717 -n reflac -- " $@ " )
1818TMPDIR=" $( mktemp --tmpdir -d reflac.XXXXXXXXXX) "
1919
@@ -29,20 +29,20 @@ usage()
2929Usage: reflac [OPTION]... [--] DIRECTORY...
3030
3131 -h --help Displays this help text
32- -V --version Displays the version of this program
33- -v --verbose Increases the verbosity. Use once to display the FLACs
34- currently being processed, use twice for the full ‘flac’
35- output.
36- -r --recursive Recurse into directories.
32+ -0 --fast Use the fastest, but worst, compression possible.
33+ -1..-7 Adjust FLAC compresion between these standard ranges.
34+ The default is -5, the same as for flac itself.
35+ -8 --best Use the slowest, but best, compression possible.
3736 -n --no-action Do not recompress. With --verbose, displays a list of
3837 files that would be processed.
3938 -p --preserve Preserve file modification time.
39+ -r --recursive Recurse into directories.
4040 -s --no-sync Do not synchronize file data. Will return faster, with
4141 the potential danger to lose your files in a system crash.
42- -0 --fast Use the fastest, but worst, compression possible.
43- -1..-7 Adjust FLAC compresion between these standard ranges.
44- The default is -5, the same as for flac itself .
45- -8 --best Use the slowest, but best, compression possible.
42+ -v --verbose Increases the verbosity. Use once to display the FLACs
43+ currently being processed, use twice for the full ‘flac’
44+ output .
45+ -V --version Displays the version of this program
4646
4747DIRECTORY should point ‘reflac’ to somewhere that contains *.flac
4848files. Optionally terminate the argument list with -- so that any
@@ -102,12 +102,6 @@ recompress()
102102
103103while true ; do
104104 case " $1 " in
105- -v|--verbose)
106- VERBOSE=$(( VERBOSE+ 1 ))
107- shift ;;
108- -r|--recursive)
109- RECURSIVE=1
110- shift ;;
111105 -0|-1|-2|-3|-4|-5|-6|-7|-8)
112106 FLAC_LEVEL=${1# -}
113107 shift ;;
@@ -117,21 +111,27 @@ while true ; do
117111 --best)
118112 FLAC_LEVEL=8
119113 shift ;;
114+ -h|--help)
115+ usage ;;
120116 -n|--no-action)
121117 NOACTION=1
122118 shift ;;
123119 -p|--preserve)
124120 PRESERVE_MODTIME=" --preserve-modtime"
125121 shift ;;
122+ -r|--recursive)
123+ RECURSIVE=1
124+ shift ;;
126125 -s|--no-sync)
127126 SYNC=0
128127 shift ;;
128+ -v|--verbose)
129+ VERBOSE=$(( VERBOSE+ 1 ))
130+ shift ;;
129131 -V|--version)
130132 echo " reflac version $VERSION "
131133 rmdir " $TMPDIR "
132134 exit 0 ;;
133- -h|--help)
134- usage ;;
135135 --) shift ; break ;;
136136 * ) echo " $0 : This should never happen!" >&2 ; exit 1 ;;
137137 esac
0 commit comments