]> git.wh0rd.org Git - home.git/commitdiff
flac2mp3: handle cli options
authorMike Frysinger <vapier@gentoo.org>
Mon, 5 Sep 2016 19:31:26 +0000 (15:31 -0400)
committerMike Frysinger <vapier@gentoo.org>
Mon, 5 Sep 2016 19:31:26 +0000 (15:31 -0400)
.bin/flac2mp3

index 4be5834d2fb457e7c4b5bdb9f128c28c31a87844..d6fe3242d33afd1a3bfdffea65415875fc5f827d 100755 (executable)
@@ -1,11 +1,22 @@
 #!/bin/bash
 
+usage() {
+       cat <<-EOF
+Usage: $0 [files]
+EOF
+       exit
+}
+
 maxj=`getconf _NPROCESSORS_ONLN`
 jobs=()
 
 [[ $# -eq 0 ]] && set -- *.flac
 
 for f in "$@" ; do
+       case ${f} in
+       -*) usage ;;
+       esac
+
        m="${f%.flac}.mp3"
        (
        flac -sdc "${f}" | \