From: Don Armstrong Date: Mon, 15 Dec 2014 23:42:12 +0000 (-0800) Subject: fix how rename is called (stop using --) X-Git-Url: https://git.donarmstrong.com/?p=bin.git;a=commitdiff_plain;h=a0b1867bf270578b551829ee91e19ea4c33100e0 fix how rename is called (stop using --) --- diff --git a/sanitize_filename b/sanitize_filename index a6dc4c1..e56e345 100755 --- a/sanitize_filename +++ b/sanitize_filename @@ -14,18 +14,13 @@ while [ $1 != "--" ]; do --anime) ANIME_CUT=1 ;; - --restart) - RESTART=1 - ;; - --force) - FORCE=1 - ;; esac; shift done; shift; +set -x if [ "$ANIME_CUT" == 0 ]; then - rename 's/\s+/\_/g; s{[^\w\d.\/]}{\_}g; s/_$//g; $_ = lc($_); s/\_+/\_/g; s/\_\././; s/^_+//g; s/_+$//g;' -- "$@" + rename 's/\s+/\_/g; s{[^\w\d.\/]}{\_}g; s/_$//g; $_ = lc($_); s/\_+/\_/g; s/\_\././; s/^_+//g; s/_+$//g;' "$@" else - rename 's{\[[^\]\/]+\]}{}g; s{\([^\)\/]+\)}{}g; s/\s+/\_/g; $_ = lc($_); s/[_-]+/\_/g; s/\_\././; s/^_+//; s/_+$//g;' -- "$@" -fi; \ No newline at end of file + rename 's{\[[^\]\/]+\]}{}g; s{\([^\)\/]+\)}{}g; s/\s+/\_/g; $_ = lc($_); s/[_-]+/\_/g; s/\_\././; s/^_+//; s/_+$//g;' "$@" +fi;