finetune line wrapping

This commit is contained in:
Ville Rantanen
2016-08-12 11:31:44 +03:00
parent 81f64a75d8
commit 34b5c2e043

View File

@@ -57,16 +57,20 @@ function deletefolders() {
done < <(find "$@" -depth -type d -print0) done < <(find "$@" -depth -type d -print0)
printf "\n" printf "\n"
} }
# stop line wrapping
printf '\033[?7l' # return line wrapping
trap "printf '\033[?7h'" 1 9 15 trap "printf '\033[?7h'" 1 9 15
files=0 files=0
folders=0 folders=0
if [[ "$NOCOUNT" -ne 1 ]]; then if [[ "$NOCOUNT" -ne 1 ]]; then
echo Listing files in "${FOLDERS[@]}" ... echo Listing files in "${FOLDERS[@]}" ...
# stop line wrapping
printf '\033[?7l'
listfiles "${FOLDERS[@]}" listfiles "${FOLDERS[@]}"
echo Prepared to delete $files files echo Prepared to delete $files files
fi fi
# stop line wrapping
printf '\033[?7l'
if [[ $FORCE -eq 0 ]]; then if [[ $FORCE -eq 0 ]]; then
echo '<ctrl-c> to quit' echo '<ctrl-c> to quit'
read foo read foo
@@ -77,5 +81,5 @@ if [[ "$NOCOUNT" -ne 1 ]]; then
echo Removing remaining $folders folders echo Removing remaining $folders folders
fi fi
deletefolders "${FOLDERS[@]}" deletefolders "${FOLDERS[@]}"
# line wrapping # return line wrapping
printf '\033[?7h' printf '\033[?7h'