summaryrefslogtreecommitdiffstats
path: root/cac
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-08-05 23:58:10 +0200
committertv <tv@shackspace.de>2015-08-05 23:58:10 +0200
commit5cf505b196b8624a72bccc418953aa337290decc (patch)
tree5c3cd201a3271aa8a402d7b354078b2cf758f16e /cac
parentdcd0493e44fac3551c3c9e0734b10a8ae0e763b7 (diff)
cac help: $PAGER only on too many lines
Diffstat (limited to 'cac')
-rwxr-xr-xcac8
1 files changed, 7 insertions, 1 deletions
diff --git a/cac b/cac
index bcf745d..ed3d6e7 100755
--- a/cac
+++ b/cac
@@ -73,7 +73,13 @@ __cac_cli__help() {(
# test -t expects GNU coreutils
if test -t 0 >/dev/null 2>&1; then
filter() {
- $PAGER "$@"
+ help=$(cat)
+ echo "$help" |
+ if test $(echo "$help" | wc -l) -gt $(tput lines); then
+ $PAGER "$@"
+ else
+ cat "$@"
+ fi
}
else
filter() {