list-cvs-files.sh: Add option -t (text-files)

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-06-02 09:06:24 +00:00
commit 0b2df04c6b

View file

@ -62,7 +62,7 @@ list_dirents()
list_dirents_git $1
}
set -- `getopt fnz "$@"`
set -- `getopt fnzt "$@"`
while [ "$1" != -- ]; do
case $1 in
@ -77,6 +77,9 @@ case $1 in
git_ls_files_opts="$git_ls_files_opts -z"
opt_sort="$opt_sort -z"
;;
-t)
text_files=1
;;
esac
shift
done
@ -85,5 +88,9 @@ shift
proj_dir="$1"
[ "$proj_dir" ] && cd $proj_dir
list_dirents . | sort $opt_sort
if [ "$text_files" ]; then
list_dirents . | sort $opt_sort | xargs file -N | grep ":.*text" | cut -d: -f1
else
list_dirents . | sort $opt_sort
fi