find_crlf: Add quiet mode

This commit is contained in:
Lexi / Zoe 2021-05-31 14:25:39 +02:00
parent bcb98b9e9a
commit e2f2acb546
Signed by: binaryDiv
GPG Key ID: F8D4956E224DA232
1 changed files with 14 additions and 1 deletions

View File

@ -9,9 +9,22 @@ EXCLUDES=(
EXCLUDE_PARAMS=()
QUIET=
if [[ $1 == '-q' ]]; then
QUIET=1
fi
for path in "${EXCLUDES[@]}"; do
EXCLUDE_PARAMS+=("-not" "-path" "$path")
done
find . -type f "${EXCLUDE_PARAMS[@]}" -exec file '{}' \; | grep 'CRLF'
find_grep_crlf() {
find . -type f "${EXCLUDE_PARAMS[@]}" -exec file '{}' \; | grep 'CRLF'
}
if [[ -n $QUIET ]]; then
find_grep_crlf | cut -d: -f1
else
find_grep_crlf
fi