aboutsummaryrefslogtreecommitdiff
path: root/ponysay
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-07-05 09:14:14 +0200
committerMattias Andrée <maandree@operamail.com>2012-07-05 09:14:14 +0200
commit4a39ef423041bee3faafc99ee60bf0dbb1229868 (patch)
tree2bd65c42ee1adf4dc91499ebcbf1cb5e1f874b73 /ponysay
parent738dc690ebfd902f0168e47a7a875c5708b8ce18 (diff)
downloadponysay-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-xponysay17
1 files changed, 12 insertions, 5 deletions
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