find_crlf: Add quiet mode
This commit is contained in:
parent
bcb98b9e9a
commit
e2f2acb546
|
|
@ -9,9 +9,22 @@ EXCLUDES=(
|
||||||
|
|
||||||
EXCLUDE_PARAMS=()
|
EXCLUDE_PARAMS=()
|
||||||
|
|
||||||
|
QUIET=
|
||||||
|
|
||||||
|
if [[ $1 == '-q' ]]; then
|
||||||
|
QUIET=1
|
||||||
|
fi
|
||||||
|
|
||||||
for path in "${EXCLUDES[@]}"; do
|
for path in "${EXCLUDES[@]}"; do
|
||||||
EXCLUDE_PARAMS+=("-not" "-path" "$path")
|
EXCLUDE_PARAMS+=("-not" "-path" "$path")
|
||||||
done
|
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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue