Some new features
This commit is contained in:
parent
fd463e0d24
commit
42cffd35cc
9 changed files with 588 additions and 2 deletions
19
functions/lesswrap
Normal file
19
functions/lesswrap
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue