Some new features

This commit is contained in:
Alexander Gehrke 2014-06-27 07:45:18 +02:00
parent fd463e0d24
commit 42cffd35cc
9 changed files with 588 additions and 2 deletions

19
functions/lesswrap Normal file
View file

@ -0,0 +1,19 @@
#!/bin/zsh
lesswrap() {
cmd="$1"
alias $cmd="autoless command ${*}"
}
autoless() {
out=$("$@")
((lim=$LINES-1))
numlines=$(echo $out | wc -l)
if (( $numlines > $lim )); then
echo $out | less
else
echo $out
fi
}
lesswrap eix -F