nicer output

This commit is contained in:
Vincent Riquer 2013-05-16 11:55:01 +02:00
parent a51d00b2e9
commit 5365eb1189

View File

@ -114,6 +114,18 @@ then
exec > "$output" exec > "$output"
fi fi
printPath() {
for key in ${!pathparts[@]}
do
if [[ ${pathparts[key]} == ${oldpathparts[key]} ]]
then
echo -n " ${pathparts[key]//?/ }"
else
echo -n "${pathparts[key]}/"
fi
done
}
printline() { printline() {
local print local print
for index in ${!show[@]} for index in ${!show[@]}
@ -129,11 +141,34 @@ printline() {
'oldtimestamp') 'oldtimestamp')
info=$(printDate ${!info}) info=$(printDate ${!info})
;; ;;
'path')
while [[ $path =~ / ]]
do
pathparts+=("${path%%/*}")
path=${path#*/}
done
pathparts+=("$path")
info=$(printPath)
unset oldpathparts
for key in ${!pathparts[@]}
do
oldpathparts[key]=${pathparts[key]}
done
unset pathparts
;;
*) *)
info="${!info}" info="${!info}"
;; ;;
esac esac
printtmp="${info:0:$locallength}" printtmp="${info:0:$locallength}"
if [ -z "$printtmp" ]
then
until (( ${#printtmp} == locallength/2))
do
printtmp+=' '
done
printtmp+='-'
fi
until (( ${#printtmp} == locallength )) until (( ${#printtmp} == locallength ))
do do
printtmp+=' ' printtmp+=' '