From 2f1566b74f83ea33d156cce3cee60f137db58489 Mon Sep 17 00:00:00 2001 From: Erkin Batu Altunbaş Date: Wed, 11 Jul 2012 18:36:18 +0300 Subject: I tried to make it a bit more portable. I hope I didn't screw something up. --- ponysay | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ponysay b/ponysay index e50b0b1..79e8339 100755 --- a/ponysay +++ b/ponysay @@ -1,13 +1,13 @@ #!/usr/bin/env bash -version=0.9 -SYSTEMPONIES=/usr/share/ponysay/ponies +version=0.10 +SYSTEMPONIES="/usr/share/ponysay/ponies" HOMEPONIES="${HOME}/.ponysay/ponies" pony="*" -wrap= +wrap="" if [ "$TERM" = "linux" ]; then - SYSTEMPONIES=/usr/share/ponysay/ttyponies + SYSTEMPONIES="/usr/share/ponysay/ttyponies" HOMEPONIES="${HOME}/.ponysay/ttyponies" fi @@ -66,7 +66,7 @@ say() { if [ "$PONYSAY_FULL_WIDTH" = 'no' ] || [ "$PONYSAY_FULL_WIDTH" = 'n' ] || [ "$PONYSAY_FULL_WIDTH" = '0' ]; then cat else - WIDTH=$((stty size <&2 || echo 0 0) | cut -d ' ' -f 2) + WIDTH=`(stty size <&2 || echo 0 0) | cut -d ' ' -f 2` ponysaytruncater $WIDTH 2>/dev/null || ${HOME}/.local/bin/ponysaytruncater $WIDTH 2>/dev/null || ./ponysaytruncater $WIDTH 2>/dev/null || @@ -79,7 +79,7 @@ say() { if [ "$PONYSAY_SHELL_LINES" = "" ]; then PONYSAY_SHELL_LINES=2 fi - head --lines=$(( $(stty size <&2 | cut -d ' ' -f 1) - $PONYSAY_SHELL_LINES )) + head --lines=`( \`stty size <&2 | cut -d ' ' -f 1\` - $PONYSAY_SHELL_LINES )` } if [ "$TERM" = "linux" ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'yes' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'y' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = '1' ]; then @@ -106,7 +106,7 @@ do done shift $((OPTIND - 1)) -if ! hash $cmd &>/dev/null; then +hash $cmd &>/dev/null; if [ $? -ne 0 ]; then cat >&2 < Date: Wed, 11 Jul 2012 18:42:49 +0300 Subject: See comment on last edit. --- ponysay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ponysay b/ponysay index 79e8339..bfe74b7 100755 --- a/ponysay +++ b/ponysay @@ -79,7 +79,7 @@ say() { if [ "$PONYSAY_SHELL_LINES" = "" ]; then PONYSAY_SHELL_LINES=2 fi - head --lines=`( \`stty size <&2 | cut -d ' ' -f 1\` - $PONYSAY_SHELL_LINES )` + head --lines=$(( `stty size <&2 | cut -d ' ' -f 1` - $PONYSAY_SHELL_LINES )) } if [ "$TERM" = "linux" ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'yes' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'y' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = '1' ]; then -- cgit From 9b2e85c10d3dc7ad1142b95e49aeb4d8e6757b02 Mon Sep 17 00:00:00 2001 From: Erkin Batu Altunbaş Date: Wed, 11 Jul 2012 18:49:45 +0300 Subject: A binary executable isn't a directory. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e9c3279..502f1b4 100644 --- a/Makefile +++ b/Makefile @@ -41,4 +41,4 @@ uninstall: unlink "$(DESTDIR)/usr/share/man/man1/ponythink.1" clean: - rm -r "ponysaytruncater" + rm "ponysaytruncater" -- cgit From cecfbf75e8b1cc930de4ac347496be9ebce88a84 Mon Sep 17 00:00:00 2001 From: Erkin Batu Altunbaş Date: Thu, 12 Jul 2012 16:46:17 +0200 Subject: A tiny bit of tweaking in documents.See issue 22 to discuss. --- manpage.1 | 109 -------------------------------------------------------------- manpage.6 | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 109 deletions(-) delete mode 100644 manpage.1 create mode 100644 manpage.6 diff --git a/manpage.1 b/manpage.1 deleted file mode 100644 index e35603f..0000000 --- a/manpage.1 +++ /dev/null @@ -1,109 +0,0 @@ -.\" -.\" First parameter, NAME, should be all caps -.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection -.\" other parameters are allowed: see man(7), man(1) -.TH PONYSAY SECTION "July 4, 2012" -.\" Please adjust this date whenever revising the manpage. -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp insert n+1 empty lines -.\" for manpage-specific macros, see man(7) -.SH NAME -ponysay \- A cowsay wrapper with ponies -.SH SYNOPSIS -.B ponysay -.RI [ options ] -.RI [ message ] -.br -.B ponythink -.RI [ options ] -.RI [ message ] -.br -.SH DESCRIPTION -.PP -.\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, -.\" respectively. -\fBponysay\fP displays an image of a pony saying some text provided by the user in a terminal. -It is a wrapper for \fIcowsay\fP. If \fImessage\fP is not provided, it accepts standard input, -word-wraps the message given at about 40 columns, and prints the pony saying the given message on standard output. -.PP -If no arguments are provided, the program only accepts standard input piped from another program, a file or -either here documents or here strings (see man bash(1) for details on here document/string.) -.PP -\fBponythink\fP is to \fIponysay\fP as \fIcowthink\fP is to \fIcowsay\fP. -.SH OPTIONS -A summary of options is included below. -.TP -.B \-h -Show summary of options. -.TP -.B \-v -Show version of program. -.TP -.B \-l -List pony files. -.TP -.B \-f \fIname\fP -Select a pony (either a file name or a pony name.) -.TP -.B \-W \fIcolumn\fP -The screen column where the message should be wrapped -.SH ENVIRONMENT -.TP -.B PONYSAY_BOTTOM -Under TTY (Linux VT), if the output is larger the the screen's height, only the beginning is -printed, leaving two blank lines. If you want the buttom to be printed rather the the beginning -you can export \fIPONYSAY_BOTTOM\fP with the value \fIyes\fP, \fIy\fP or \fI1\fP. -.TP -.B PONYSAY_SHELL_LINES -Under TTY (Linux VT), if the output is larger the the screen's height, two lines are left blank. -If you want more, or less, blank lines you can export \fIPONYSAY_SHELL_LINES\fP with the value -of how many blank lines you want. Naturally this takes effect if the output is not actually larger -than the screen. -.TP -.B PONYSAY_FULL_WIDTH -You can export \fIPONYSAY_FULL_WIDTH\fP with the value \fIno\fP, \fIn\fP or \fI0\fP, if you -do not want the output to be truncated on the width to fit the terminal. -.TP -.B PONYSAY_TRUNCATE_HEIGHT -Export \fIPONYSAY_TRUNCATE_HEIGHT\fP with the value \fIyes\fP, \fIy\fP or \fI1\fP, if you -want to truncate the output on the height even if you are not running \fIponysay\fP under TTY. -.SH BUG -Bugs can be reported in <\fBhttps://github.com/erkin/ponysay/issues\fP>. -.SH SEE ALSO -.BR cowsay (1), -.BR fortune (1). -.br -.SH AUTHOR -ponysay was written by Erkin Batu Altunbaş -with contributions from Mattias Andrée, Sven-Hendrik Haase, Jan Alexander Steffens &a. -.\" See file CREDITS for full list -.PP -This manual page was written by Louis Taylor -for the Debian project (and may be used by others), and edited -by Mattias Andrée . -.br -.SH COPYRIGHT -DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE -.br -Version 2, December 2004 -.PP -Copyright (C) 2012 Erkin Batu Altunbaş -.PP -Everyone is permitted to copy and distribute verbatim or modified -copies of this license document, and changing it is allowed as long -as the name is changed. -.PP -DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE -.br -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -.PP -0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/manpage.6 b/manpage.6 new file mode 100644 index 0000000..4b76a69 --- /dev/null +++ b/manpage.6 @@ -0,0 +1,96 @@ +.\" +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH PONYSAY 6 "July 12, 2012" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +ponysay \- A cowsay wrapper with ponies +.SH SYNOPSIS +.B ponysay +.RI [ options ] +.RI [ message ] +.br +.B ponythink +.RI [ options ] +.RI [ message ] +.br +.SH DESCRIPTION +.PP +.\" TeX users may be more comfortable with the \fB\fP and +.\" \fI\fP escape sequences to invode bold face and italics, +.\" respectively. +\fBponysay\fP displays an image of a pony saying some text provided by the user in a terminal. +It is a wrapper for \fIcowsay\fP. If \fImessage\fP is not provided, it accepts standard input, +word-wraps the message given at about 40 columns, and prints the pony saying the given message on standard output. +.PP +If no arguments are provided, the program only accepts standard input piped from another program, a file or +either here documents or here strings (see man bash(1) for details on here document/string.) +.PP +\fBponythink\fP is to \fIponysay\fP as \fIcowthink\fP is to \fIcowsay\fP. +.SH OPTIONS +A summary of options is included below. +.TP +.B \-h +Show summary of options. +.TP +.B \-v +Show version of program. +.TP +.B \-l +List pony files. +.TP +.B \-f \fIname\fP +Select a pony (either a file name or a pony name.) +.TP +.B \-W \fIcolumn\fP +The screen column where the message should be wrapped +.SH ENVIRONMENT +.TP +.B PONYSAY_BOTTOM +Under TTY (Linux VT), if the output is larger the the screen's height, only the beginning is +printed, leaving two blank lines. If you want the buttom to be printed rather the the beginning +you can export \fIPONYSAY_BOTTOM\fP with the value \fIyes\fP, \fIy\fP or \fI1\fP. +.TP +.B PONYSAY_SHELL_LINES +Under TTY (Linux VT), if the output is larger the the screen's height, two lines are left blank. +If you want more, or less, blank lines you can export \fIPONYSAY_SHELL_LINES\fP with the value +of how many blank lines you want. Naturally this takes effect if the output is not actually larger +than the screen. +.TP +.B PONYSAY_FULL_WIDTH +You can export \fIPONYSAY_FULL_WIDTH\fP with the value \fIno\fP, \fIn\fP or \fI0\fP, if you +do not want the output to be truncated on the width to fit the terminal. +.TP +.B PONYSAY_TRUNCATE_HEIGHT +Export \fIPONYSAY_TRUNCATE_HEIGHT\fP with the value \fIyes\fP, \fIy\fP or \fI1\fP, if you +want to truncate the output on the height even if you are not running \fIponysay\fP under TTY. +.SH BUG +Bugs can be reported in <\fBhttps://github.com/erkin/ponysay/issues\fP>. +.SH SEE ALSO +.BR cowsay (1), +.BR fortune (1). +.br +.SH AUTHOR +ponysay was written by Erkin Batu Altunbaş +with major contributions from Mattias Andrée, Sven-Hendrik Haase, Jan Alexander Steffens et al. +.\" See file CREDITS for full list. +.PP +This manual page was written by Louis Taylor +for the Debian project (and may be used by others), and edited +by Mattias Andrée . +.br +.PP +This program is licensed under WTFPL. +.\" See file COPYING to see the license. -- cgit From c8c0aa155d6a90d3be2efc88a0224d8496acb0f0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 12 Jul 2012 16:58:05 +0300 Subject: Update master --- manpage.6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manpage.6 b/manpage.6 index 4b76a69..e25a560 100644 --- a/manpage.6 +++ b/manpage.6 @@ -80,7 +80,7 @@ want to truncate the output on the height even if you are not running \fIponysay Bugs can be reported in <\fBhttps://github.com/erkin/ponysay/issues\fP>. .SH SEE ALSO .BR cowsay (1), -.BR fortune (1). +.BR fortune (6). .br .SH AUTHOR ponysay was written by Erkin Batu Altunbaş -- cgit From fc3d2d660a95244f11fa7bbb9a004a13e7f3cda0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 12 Jul 2012 16:59:18 +0300 Subject: The manpage is currently in section 6, not section 1 (issue #22 is open) --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 502f1b4..ca6a5e1 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,8 @@ install: all install "COPYING" "$(DESTDIR)/usr/share/licenses/ponysay/COPYING" mkdir -p "$(DESTDIR)/usr/share/man/man1" - install "manpage.1" "$(DESTDIR)/usr/share/man/man1/ponysay.1" - ln -sf "ponysay.1" "$(DESTDIR)/usr/share/man/man1/ponythink.1" + install "manpage.6" "$(DESTDIR)/usr/share/man/man1/ponysay.6" + ln -sf "ponysay.6" "$(DESTDIR)/usr/share/man/man1/ponythink.6" uninstall: rm -fr "$(DESTDIR)/usr/share/ponysay/ponies" @@ -37,8 +37,8 @@ uninstall: unlink "$(DESTDIR)/usr/share/zsh/site-functions/_ponysay"; unlink "$(DESTDIR)/usr/share/licenses/ponysay/COPYING" unlink "$(DESTDIR)/usr/share/bash-completion/completions/ponysay" - unlink "$(DESTDIR)/usr/share/man/man1/ponysay.1" - unlink "$(DESTDIR)/usr/share/man/man1/ponythink.1" + unlink "$(DESTDIR)/usr/share/man/man1/ponysay.6" + unlink "$(DESTDIR)/usr/share/man/man1/ponythink.6" clean: rm "ponysaytruncater" -- cgit From 3347fa84c3dbab2b40ef683df2d7a57d548db2cc Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 12 Jul 2012 16:59:47 +0300 Subject: missed one line --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ca6a5e1..079092e 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ install: all mkdir -p "$(DESTDIR)/usr/share/licenses/ponysay/" install "COPYING" "$(DESTDIR)/usr/share/licenses/ponysay/COPYING" - mkdir -p "$(DESTDIR)/usr/share/man/man1" + mkdir -p "$(DESTDIR)/usr/share/man/man6" install "manpage.6" "$(DESTDIR)/usr/share/man/man1/ponysay.6" ln -sf "ponysay.6" "$(DESTDIR)/usr/share/man/man1/ponythink.6" -- cgit From 9f4f748cf95407ba9fd4d8a8c347d735fab1416e Mon Sep 17 00:00:00 2001 From: Erkin Batu Altunbaş Date: Thu, 12 Jul 2012 17:07:22 +0300 Subject: ponysaytruncater seems to be writeprotected. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 079092e..e5b870f 100644 --- a/Makefile +++ b/Makefile @@ -41,4 +41,4 @@ uninstall: unlink "$(DESTDIR)/usr/share/man/man1/ponythink.6" clean: - rm "ponysaytruncater" + rm -f "ponysaytruncater" -- cgit From dbfb357d7cea1732786c7cd49211910cc84e7e43 Mon Sep 17 00:00:00 2001 From: Erkin Batu Altunbaş Date: Thu, 12 Jul 2012 19:06:41 +0200 Subject: makefile mistake man1 instead of man6 --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e5b870f..eac642f 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,8 @@ install: all install "COPYING" "$(DESTDIR)/usr/share/licenses/ponysay/COPYING" mkdir -p "$(DESTDIR)/usr/share/man/man6" - install "manpage.6" "$(DESTDIR)/usr/share/man/man1/ponysay.6" - ln -sf "ponysay.6" "$(DESTDIR)/usr/share/man/man1/ponythink.6" + install "manpage.6" "$(DESTDIR)/usr/share/man/man6/ponysay.6" + ln -sf "ponysay.6" "$(DESTDIR)/usr/share/man/man6/ponythink.6" uninstall: rm -fr "$(DESTDIR)/usr/share/ponysay/ponies" @@ -37,8 +37,8 @@ uninstall: unlink "$(DESTDIR)/usr/share/zsh/site-functions/_ponysay"; unlink "$(DESTDIR)/usr/share/licenses/ponysay/COPYING" unlink "$(DESTDIR)/usr/share/bash-completion/completions/ponysay" - unlink "$(DESTDIR)/usr/share/man/man1/ponysay.6" - unlink "$(DESTDIR)/usr/share/man/man1/ponythink.6" + unlink "$(DESTDIR)/usr/share/man/man6/ponysay.6" + unlink "$(DESTDIR)/usr/share/man/man6/ponythink.6" clean: rm -f "ponysaytruncater" -- cgit From 0d7cbc70d75169e5debbe5c67b4eb8773835dd80 Mon Sep 17 00:00:00 2001 From: Erkin Batu Altunbaş Date: Fri, 13 Jul 2012 02:18:53 +0200 Subject: tiny fix in help --- ponysay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ponysay b/ponysay index bfe74b7..7ec7943 100755 --- a/ponysay +++ b/ponysay @@ -43,7 +43,7 @@ Options: -f[name] Select a pony (either a file name or a pony name.) -W[column] The screen column where the message should be wrapped. -See man ponysay(1) for more information. +See man ponysay(6) for more information. EOF } -- cgit