From 4a39ef423041bee3faafc99ee60bf0dbb1229868 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 5 Jul 2012 09:14:14 +0200 Subject: ponythink in manpage + environment variables PONYSAY_SHELL_LINES and PONYSAY_FULL_WIDTH --- ponysay | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'ponysay') diff --git a/ponysay b/ponysay index 4b5e912..9b5b2af 100755 --- a/ponysay +++ b/ponysay @@ -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 -- cgit