diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-07-05 09:14:14 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-07-05 09:14:14 +0200 |
commit | 4a39ef423041bee3faafc99ee60bf0dbb1229868 (patch) | |
tree | 2bd65c42ee1adf4dc91499ebcbf1cb5e1f874b73 /ponysay | |
parent | 738dc690ebfd902f0168e47a7a875c5708b8ce18 (diff) | |
download | ponysay-4a39ef423041bee3faafc99ee60bf0dbb1229868.tar.gz ponysay-4a39ef423041bee3faafc99ee60bf0dbb1229868.tar.bz2 ponysay-4a39ef423041bee3faafc99ee60bf0dbb1229868.zip |
ponythink in manpage + environment variables PONYSAY_SHELL_LINES and PONYSAY_FULL_WIDTH
Diffstat (limited to 'ponysay')
-rwxr-xr-x | ponysay | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -63,15 +63,22 @@ say() { function wtrunc { - ponysaytruncater `tput cols || echo 0` 2>/dev/null || - ${HOME}/.local/bin/ponysaytruncater `tput cols || echo 0` 2>/dev/null || - ./ponysaytruncater `tput cols || echo 0` 2>/dev/null || - cat + if [ "$PONYSAY_FULL_WIDTH" = 'no' ] || [ "$PONYSAY_FULL_WIDTH" = 'n' ] || [ "$PONYSAY_FULL_WIDTH" = '0' ]; then + cat + else + ponysaytruncater `tput cols || echo 0` 2>/dev/null || + ${HOME}/.local/bin/ponysaytruncater `tput cols || echo 0` 2>/dev/null || + ./ponysaytruncater `tput cols || echo 0` 2>/dev/null || + cat + fi } function htrunc { - head --lines=$(( $(stty size <&2 | cut -d ' ' -f 1) - 2 )) + if [ "$PONYSAY_SHELL_LINES" = "" ]; then + PONYSAY_SHELL_LINES=2 + fi + head --lines=$(( $(stty size <&2 | cut -d ' ' -f 1) - $PONYSAY_SHELL_LINES )) } if [ "$TERM" = "linux" ]; then |