X-Git-Url: https://git.donarmstrong.com/?p=bin.git;a=blobdiff_plain;f=sanitize_filename;h=e56e3451b12169a0352ad0bb01ba4fc98cef8cc0;hp=fce84936dad1496422fa4b64cf304e8d6b3bcc65;hb=HEAD;hpb=0adc1e7e8943bc31f0a0555939226764c9c25805 diff --git a/sanitize_filename b/sanitize_filename index fce8493..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;' -- "$@" + 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/^_+//;' -- "$@" -fi; \ No newline at end of file + rename 's{\[[^\]\/]+\]}{}g; s{\([^\)\/]+\)}{}g; s/\s+/\_/g; $_ = lc($_); s/[_-]+/\_/g; s/\_\././; s/^_+//; s/_+$//g;' "$@" +fi;