diff options
author | tv <tv@shackspace.de> | 2015-08-05 23:58:10 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-08-05 23:58:10 +0200 |
commit | 5cf505b196b8624a72bccc418953aa337290decc (patch) | |
tree | 5c3cd201a3271aa8a402d7b354078b2cf758f16e | |
parent | dcd0493e44fac3551c3c9e0734b10a8ae0e763b7 (diff) |
cac help: $PAGER only on too many lines
-rwxr-xr-x | cac | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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() { |