Compare commits
21 Commits
squidwarez
...
origin
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d66b866cf1 | ||
![]() |
2069267e70 | ||
![]() |
38fed456fa | ||
![]() |
df9da77a6c | ||
![]() |
b2e6dd28a9 | ||
![]() |
d6f7d8a3a7 | ||
![]() |
2556105c80 | ||
![]() |
5143a99c77 | ||
![]() |
7a8dd12712 | ||
![]() |
7ad688118c | ||
![]() |
37d570cc84 | ||
![]() |
e80035bc01 | ||
![]() |
65484457e3 | ||
![]() |
5611583965 | ||
![]() |
5e36334173 | ||
![]() |
7f755e175e | ||
![]() |
039a2a3218 | ||
![]() |
2a31c59534 | ||
![]() |
48b41128da | ||
![]() |
f0d882e98f | ||
![]() |
218d8cbdf7 |
31
ChangeLog
Normal file
31
ChangeLog
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
3.03 28 May 1999
|
||||||
|
- Added cows/tux.cow, as suggested by xmanoel@i.am
|
||||||
|
- Compatibility with 5.6.0, due to a change in qw().
|
||||||
|
- Renamed devil.cow to daemon.cow, since I know better. :-)
|
||||||
|
|
||||||
|
3.02 04 November 1999
|
||||||
|
- Fixed boneheaded code placement so that cowsay -l actually works.
|
||||||
|
|
||||||
|
3.01 01 November 1999
|
||||||
|
- Fixed compatibility issues between the Text::Wrap module
|
||||||
|
that changed between 5.005_02 and 5.005_03.
|
||||||
|
- Fixed tab expansion issues with Text::Tabs.
|
||||||
|
|
||||||
|
3.0 13 April 1999, released 14 August 1999
|
||||||
|
- Rewritten into Perl 5 and presented to the world.
|
||||||
|
|
||||||
|
-- Not present in CVS from here on down --
|
||||||
|
|
||||||
|
2.x Date?
|
||||||
|
- Arbitrary messages.
|
||||||
|
- Figlet support (-n).
|
||||||
|
- Line wrap length (-w).
|
||||||
|
- Multiple pre-set expressions.
|
||||||
|
- Better arg parsing loop.
|
||||||
|
- Message from stdin or command line.
|
||||||
|
|
||||||
|
1.0 Date?
|
||||||
|
- SUBJECT is VERB OBJECT
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
This file is part of cowsay. (c) 1999-2000 Tony Monroe.
|
58
Files.base
Normal file
58
Files.base
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
ChangeLog
|
||||||
|
INSTALL
|
||||||
|
LICENSE
|
||||||
|
MANIFEST
|
||||||
|
README
|
||||||
|
Wrap.pm.diff
|
||||||
|
install.sh
|
||||||
|
pgp_public_key.txt
|
||||||
|
cowsay
|
||||||
|
cowsay.1
|
||||||
|
cows/
|
||||||
|
cows/beavis.zen.cow
|
||||||
|
cows/bong.cow
|
||||||
|
cows/bud-frogs.cow
|
||||||
|
cows/bunny.cow
|
||||||
|
cows/cheese.cow
|
||||||
|
cows/cower.cow
|
||||||
|
cows/daemon.cow
|
||||||
|
cows/default.cow
|
||||||
|
cows/dragon-and-cow.cow
|
||||||
|
cows/dragon.cow
|
||||||
|
cows/elephant-in-snake.cow
|
||||||
|
cows/elephant.cow
|
||||||
|
cows/eyes.cow
|
||||||
|
cows/flaming-sheep.cow
|
||||||
|
cows/ghostbusters.cow
|
||||||
|
cows/head-in.cow
|
||||||
|
cows/hellokitty.cow
|
||||||
|
cows/kiss.cow
|
||||||
|
cows/kitty.cow
|
||||||
|
cows/koala.cow
|
||||||
|
cows/kosh.cow
|
||||||
|
cows/luke-koala.cow
|
||||||
|
cows/mech-and-cow
|
||||||
|
cows/meow.cow
|
||||||
|
cows/milk.cow
|
||||||
|
cows/moofasa.cow
|
||||||
|
cows/moose.cow
|
||||||
|
cows/mutilated.cow
|
||||||
|
cows/ren.cow
|
||||||
|
cows/satanic.cow
|
||||||
|
cows/sheep.cow
|
||||||
|
cows/skeleton.cow
|
||||||
|
cows/small.cow
|
||||||
|
cows/sodomized.cow
|
||||||
|
cows/stegosaurus.cow
|
||||||
|
cows/stimpy.cow
|
||||||
|
cows/supermilker.cow
|
||||||
|
cows/surgery.cow
|
||||||
|
cows/telebears.cow
|
||||||
|
cows/three-eyes.cow
|
||||||
|
cows/turkey.cow
|
||||||
|
cows/turtle.cow
|
||||||
|
cows/tux.cow
|
||||||
|
cows/udder.cow
|
||||||
|
cows/vader-koala.cow
|
||||||
|
cows/www.cow
|
||||||
|
cows/vader.cow
|
15
INSTALL
Normal file
15
INSTALL
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
=================
|
||||||
|
Installing cowsay
|
||||||
|
=================
|
||||||
|
|
||||||
|
If you really want to get things installed a nice and pretty way,
|
||||||
|
|
||||||
|
sh install.sh
|
||||||
|
|
||||||
|
It will ask approximately one question. If you can't answer it,
|
||||||
|
you need serious help.
|
||||||
|
|
||||||
|
If the install goes well, you can start cowing immediately! Just
|
||||||
|
be sure to read the manual page first...
|
||||||
|
|
||||||
|
$Id$
|
36
LICENSE
Normal file
36
LICENSE
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
==============
|
||||||
|
cowsay License
|
||||||
|
==============
|
||||||
|
|
||||||
|
cowsay is distributed under the same licensing terms as Perl: the
|
||||||
|
Artistic License or the GNU General Public License. If you don't
|
||||||
|
want to track down these licenses and read them for yourself, use
|
||||||
|
the parts that I'd prefer:
|
||||||
|
|
||||||
|
(0) I wrote it and you didn't.
|
||||||
|
|
||||||
|
(1) Give credit where credit is due if you borrow the code for some
|
||||||
|
other purpose.
|
||||||
|
|
||||||
|
(2) If you have any bugfixes or suggestions, please notify me so
|
||||||
|
that I may incorporate them.
|
||||||
|
|
||||||
|
(3) If you try to make money off of cowsay, you suck.
|
||||||
|
|
||||||
|
===============
|
||||||
|
cowsay Legalese
|
||||||
|
===============
|
||||||
|
|
||||||
|
(0) Copyright (c) 1999 Tony Monroe. All rights reserved. All
|
||||||
|
lefts may or may not be reversed at my discretion.
|
||||||
|
|
||||||
|
(1) This software package can be freely redistributed or modified
|
||||||
|
under the terms described above in the "cowsay License" section
|
||||||
|
of this file.
|
||||||
|
|
||||||
|
(2) cowsay is provided "as is," with no warranties whatsoever,
|
||||||
|
expressed or implied. If you want some implied warranty about
|
||||||
|
merchantability and/or fitness for a particular purpose, you will
|
||||||
|
not find it here, because there is no such thing here.
|
||||||
|
|
||||||
|
(3) I hate legalese.
|
11
MANIFEST
Normal file
11
MANIFEST
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
ChangeLog Changes to recent versions.
|
||||||
|
INSTALL Instructions for installing cowsay.
|
||||||
|
LICENSE The license for use and redistribution of cowsay.
|
||||||
|
MANIFEST This file.
|
||||||
|
README Read this first. Really.
|
||||||
|
Wrap.pm.diff Diff for Text/Wrap.pm.
|
||||||
|
cows/* Support files used by cowsay.
|
||||||
|
cowsay Main cowsay executable.
|
||||||
|
cowsay.1 Main cowsay manual page.
|
||||||
|
install.sh cowsay installation script.
|
||||||
|
pgp_public_key.txt Verify the signature file with this key.
|
40
Makefile
Normal file
40
Makefile
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
##
|
||||||
|
## Makefile for managing simple NetHirc-related tasks
|
||||||
|
##
|
||||||
|
## $Id$
|
||||||
|
##
|
||||||
|
|
||||||
|
FILES= Files.base
|
||||||
|
PRODUCT= cowsay
|
||||||
|
VER= 3.03
|
||||||
|
BASE= ${PRODUCT}-${VER}
|
||||||
|
TARZ= ${BASE}.tar.Z
|
||||||
|
TARGZ= ${BASE}.tar.gz
|
||||||
|
TARS= ${TARZ} ${TARGZ}
|
||||||
|
SIGZ= ${TARZ}.sig
|
||||||
|
SIGGZ= ${TARGZ}.sig
|
||||||
|
SIGS= ${SIGZ} ${SIGGZ}
|
||||||
|
FTP= jariten:ftp/cowsay
|
||||||
|
|
||||||
|
release: run-pax sign upload
|
||||||
|
|
||||||
|
tar: run-pax
|
||||||
|
|
||||||
|
run-pax: ${FILES}
|
||||||
|
-chmod +x install.sh
|
||||||
|
pax -w -d -x tar \
|
||||||
|
-s ",^,${BASE}/," \
|
||||||
|
-f ${BASE}.tar \
|
||||||
|
`cat ${FILES}`
|
||||||
|
gzip -c ${BASE}.tar > ${TARGZ}
|
||||||
|
compress ${BASE}.tar
|
||||||
|
|
||||||
|
sign: ${TARS}
|
||||||
|
for i in ${TARS}; do pgp -sb $$i; done
|
||||||
|
chmod 644 ${SIGS}
|
||||||
|
|
||||||
|
upload: ${TARS} ${SIGS}
|
||||||
|
scp ${TARS} ${SIGS} ${FTP}
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-rm -f ${TARS} ${SIGS}
|
38
README
Normal file
38
README
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
===========
|
||||||
|
cowsay 3.03
|
||||||
|
===========
|
||||||
|
|
||||||
|
cowsay is a configurable talking cow, written in Perl. It operates
|
||||||
|
much as the figlet program does, and it written in the same spirit
|
||||||
|
of silliness.
|
||||||
|
|
||||||
|
cowsay is actually a pretty old program. It has not really been
|
||||||
|
released before, and I am releasing it in the hope that someone
|
||||||
|
other than myself will be amused by it.
|
||||||
|
|
||||||
|
The first major version of cowsay had one cow and one message
|
||||||
|
template: $foo is $verb $bar. Not very flexible, but people managed
|
||||||
|
to do pretty interesting things with it. The second major version
|
||||||
|
scrapped many of the limitations of the first, by allowing arbitrary
|
||||||
|
messages, multiple cowfiles, and even support for cows talking in
|
||||||
|
figlet. The third version was a rewrite of the second into Perl
|
||||||
|
5, whereupon the code got a lot smaller and more manageable. :-)
|
||||||
|
|
||||||
|
If you are using Perl 5.004, you may have problems with Text::Wrap.
|
||||||
|
(Yeesh, this module changes more than it should...) I've included
|
||||||
|
a diff for the Text::Wrap (version 97.011701) that is shipped with
|
||||||
|
5.004_04; the concept is simple enough that even older Perls can
|
||||||
|
take advantage of this silly little patch; if there is a "sub fill"
|
||||||
|
in the documentation for the module, copy it to a more useful
|
||||||
|
section of that file. If not, just take "sub fill" wholesale from
|
||||||
|
the patch. Oh, and consider upgrading to 5.005_03 or later.
|
||||||
|
Please. You'll like it, I promise.
|
||||||
|
|
||||||
|
To install cowsay, consult the INSTALL file in this directory.
|
||||||
|
|
||||||
|
For the terms and conditions of use, consult the LICENSE file in
|
||||||
|
this directory.
|
||||||
|
|
||||||
|
-- Tony Monroe (tony@nog.net)
|
||||||
|
|
||||||
|
$Id$
|
25
RELEASE
Normal file
25
RELEASE
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
Steps to be done for release:
|
||||||
|
|
||||||
|
(0) Change version number in cowsay file.
|
||||||
|
|
||||||
|
(1) Change version number in Makefile.
|
||||||
|
|
||||||
|
(2) Change version number in README.
|
||||||
|
|
||||||
|
(3) Change version number in cowsay.1.
|
||||||
|
|
||||||
|
(4) CVS tag.
|
||||||
|
|
||||||
|
(5) Package into tarballs and sign.
|
||||||
|
|
||||||
|
(6) Upload tarballs to FTP server.
|
||||||
|
|
||||||
|
(7) Point LATEST.tar.gz to current version.
|
||||||
|
|
||||||
|
(8) Modify cowsay web pages to reflect current version.
|
||||||
|
|
||||||
|
(9) Modify factoids with purl and miho to reflect current version.
|
||||||
|
|
||||||
|
(10) Post to freshmeat.
|
||||||
|
|
||||||
|
$Id$
|
47
Wrap.pm.diff
Normal file
47
Wrap.pm.diff
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
*** Wrap.pm.in Thu May 22 00:21:42 1997
|
||||||
|
--- Wrap.pm Fri Nov 12 10:00:15 1999
|
||||||
|
***************
|
||||||
|
*** 3,9 ****
|
||||||
|
require Exporter;
|
||||||
|
|
||||||
|
@ISA = (Exporter);
|
||||||
|
! @EXPORT = qw(wrap);
|
||||||
|
@EXPORT_OK = qw($columns);
|
||||||
|
|
||||||
|
$VERSION = 97.011701;
|
||||||
|
--- 3,9 ----
|
||||||
|
require Exporter;
|
||||||
|
|
||||||
|
@ISA = (Exporter);
|
||||||
|
! @EXPORT = qw(wrap fill);
|
||||||
|
@EXPORT_OK = qw($columns);
|
||||||
|
|
||||||
|
$VERSION = 97.011701;
|
||||||
|
***************
|
||||||
|
*** 66,71 ****
|
||||||
|
--- 66,90 ----
|
||||||
|
|
||||||
|
print "-----------$r---------\n" if $debug;;
|
||||||
|
return $r;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ ## Copied up from below.
|
||||||
|
+ sub fill
|
||||||
|
+ {
|
||||||
|
+ my ($ip, $xp, @raw) = @_;
|
||||||
|
+ my @para;
|
||||||
|
+ my $pp;
|
||||||
|
+
|
||||||
|
+ for $pp (split(/\n\s+/, join("\n",@raw))) {
|
||||||
|
+ $pp =~ s/\s+/ /g;
|
||||||
|
+ my $x = wrap($ip, $xp, $pp);
|
||||||
|
+ push(@para, $x);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ # if paragraph_indent is the same as line_indent,
|
||||||
|
+ # separate paragraphs with blank lines
|
||||||
|
+
|
||||||
|
+ return join ($ip eq $xp ? "\n\n" : "\n", @para);
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
4
cowenv
Normal file
4
cowenv
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# $Id$
|
||||||
|
# Development environment settings for cowsay
|
||||||
|
COWPATH=`pwd`/cows
|
||||||
|
export COWPATH
|
36
cows/DragonAndCow.pm
Normal file
36
cows/DragonAndCow.pm
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
package Acme::Cow::DragonAndCow;
|
||||||
|
use strict;
|
||||||
|
use Acme::Cow;
|
||||||
|
@Acme::Cow::DragonAndCow::ISA = qw(Acme::Cow);
|
||||||
|
my $dragon_and_cow = <<'EOC';
|
||||||
|
{$balloon}
|
||||||
|
{$tl} ^ /^
|
||||||
|
{$tl} / \ // \
|
||||||
|
{$tl} |\___/| / \// .\
|
||||||
|
{$tl} /O O \__ / // | \ \ *----*
|
||||||
|
/ / \/_/ // | \ \ \ |
|
||||||
|
@___@` \/_ // | \ \ \/\ \
|
||||||
|
0/0/| \/_ // | \ \ \ \
|
||||||
|
0/0/0/0/| \/// | \ \ | |
|
||||||
|
0/0/0/0/0/_|_ / ( // | \ _\ | /
|
||||||
|
0/0/0/0/0/0/`/,_ _ _/ ) ; -. | _ _\.-~ / /
|
||||||
|
,-\} _ *-.|.-~-. .~ ~
|
||||||
|
\ \__/ `/\ / ~-. _ .-~ /
|
||||||
|
\____({$el}{$er}) *. \} \{ /
|
||||||
|
( (--) .----~-.\ \-` .~
|
||||||
|
//__\\ \__ Ack! ///.----..< \ _ -~
|
||||||
|
// \\ ///-._ _ _ _ _ _ _\{^ - - - - ~
|
||||||
|
EOC
|
||||||
|
sub new
|
||||||
|
{
|
||||||
|
my $proto = shift;
|
||||||
|
my $class = ref $proto || $proto;
|
||||||
|
my $self = $class->SUPER::new();
|
||||||
|
return bless $self, $class;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub as_string
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
return $self->SUPER::as_string($dragon_and_cow);
|
||||||
|
}
|
149
cows/Example.pm
Normal file
149
cows/Example.pm
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
package Acme::Cow::Example;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
use Acme::Cow;
|
||||||
|
|
||||||
|
@Acme::Cow::Example::ISA = qw(Acme::Cow);
|
||||||
|
|
||||||
|
my $generic_ascii_art = <<'EOC';
|
||||||
|
{$balloon}
|
||||||
|
{$tr}
|
||||||
|
{$el}{$er} {$tr}
|
||||||
|
___________________
|
||||||
|
/ Insert cute ASCII \
|
||||||
|
\ artwork here. /
|
||||||
|
-------------------
|
||||||
|
{$U}
|
||||||
|
EOC
|
||||||
|
|
||||||
|
sub new
|
||||||
|
{
|
||||||
|
my $proto = shift;
|
||||||
|
my $class = ref $proto || $proto;
|
||||||
|
my $self = $class->SUPER::new();
|
||||||
|
$self->over(24);
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub as_string
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
return $self->SUPER::as_string($generic_ascii_art);
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
__END__
|
||||||
|
=pod
|
||||||
|
|
||||||
|
=head1 NAME
|
||||||
|
|
||||||
|
Acme::Cow::Example - How to write a "derived cow"
|
||||||
|
|
||||||
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
package Acme::Cow::MyCow;
|
||||||
|
use Acme::Cow;
|
||||||
|
@Acme::Cow::MyCow::ISA = qw(Acme::Cow);
|
||||||
|
|
||||||
|
my $my_cow = <<'EOC';
|
||||||
|
... template goes here ...
|
||||||
|
EOC
|
||||||
|
|
||||||
|
sub new { ... }
|
||||||
|
|
||||||
|
sub as_string { ... }
|
||||||
|
|
||||||
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
|
First, put together your template as described in L<Acme::Cow>,
|
||||||
|
using L<Text::Template> as a reference. It is recommended that
|
||||||
|
you store this template in a variable in your package's namespace.
|
||||||
|
B<Your template should not have tab characters in it.> This will
|
||||||
|
cause ugly things to happen.
|
||||||
|
|
||||||
|
Your C<new> method will likely want to look a lot like this:
|
||||||
|
|
||||||
|
sub new
|
||||||
|
{
|
||||||
|
my $proto = shift;
|
||||||
|
my $class = ref $proto || $proto;
|
||||||
|
my $self = $class->SUPER::new();
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
Assuming you stored the template as C<$my_cow> then
|
||||||
|
your C<as_string> method will likely want to be like this:
|
||||||
|
|
||||||
|
sub as_string
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
return $self->SUPER::as_string($my_cow);
|
||||||
|
}
|
||||||
|
|
||||||
|
Below, we present the actual code in this module, so you can see
|
||||||
|
it in action. Yes, you can use this module to produce ASCII art.
|
||||||
|
No, it won't be very exciting.
|
||||||
|
|
||||||
|
=head1 Acme::Cow::Example code
|
||||||
|
|
||||||
|
package Acme::Cow::Example;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
use Acme::Cow;
|
||||||
|
|
||||||
|
@Acme::Cow::Example::ISA = qw(Acme::Cow);
|
||||||
|
|
||||||
|
my $generic_ascii_art = <<'EOC';
|
||||||
|
{$balloon}
|
||||||
|
{$tr}
|
||||||
|
{$el}{$er} {$tr}
|
||||||
|
___________________
|
||||||
|
/ Insert cute ASCII \
|
||||||
|
\ artwork here. /
|
||||||
|
-------------------
|
||||||
|
{$U}
|
||||||
|
EOC
|
||||||
|
|
||||||
|
sub new
|
||||||
|
{
|
||||||
|
my $proto = shift;
|
||||||
|
my $class = ref $proto || $proto;
|
||||||
|
my $self = $class->SUPER::new();
|
||||||
|
$self->over(24);
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub as_string
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
return $self->SUPER::as_string($generic_ascii_art);
|
||||||
|
}
|
||||||
|
|
||||||
|
=head1 HIGHLIGHTS
|
||||||
|
|
||||||
|
The C<{$balloon}> directive is flush left, but due to the call to
|
||||||
|
C<over()> in the C<new()> method, it will be shoved over 24 spaces
|
||||||
|
to the right, to line up with the thought/speech lines (represented
|
||||||
|
by C<{$tr}>).
|
||||||
|
|
||||||
|
=head1 SAVING WORK
|
||||||
|
|
||||||
|
Included with the C<Acme::Cow> distribution is a short program
|
||||||
|
called C<cowpm> which takes care of most of the boilerplate stuff
|
||||||
|
for you. It's almost as simple as I<just add ASCII art> but there's
|
||||||
|
still a bit that you have to fill in. It has its own documentation;
|
||||||
|
you should peruse L<cowpm>.
|
||||||
|
|
||||||
|
=head1 SEE ALSO
|
||||||
|
|
||||||
|
L<Acme::Cow>, L<cowpm>
|
||||||
|
|
||||||
|
=head1 AUTHOR
|
||||||
|
|
||||||
|
Tony Monroe <tmonroe plus perl at nog dot net>
|
||||||
|
|
||||||
|
=head1 BUGS
|
||||||
|
|
||||||
|
Very few.
|
35
cows/Frogs.pm
Normal file
35
cows/Frogs.pm
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
package Acme::Cow::Frogs;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
use Acme::Cow;
|
||||||
|
|
||||||
|
@Acme::Cow::Frogs::ISA = qw(Acme::Cow);
|
||||||
|
|
||||||
|
my $frogs = <<'EOC';
|
||||||
|
{$balloon}
|
||||||
|
{$tr}
|
||||||
|
{$tr}
|
||||||
|
oO)-. .-(Oo
|
||||||
|
/__ _\ /_ __\
|
||||||
|
\ \( | ()~() | )/ /
|
||||||
|
\__|\ | (-___-) | /|__/
|
||||||
|
' '--' ==`-'== '--' '
|
||||||
|
EOC
|
||||||
|
|
||||||
|
sub new
|
||||||
|
{
|
||||||
|
my $proto = shift;
|
||||||
|
my $class = ref $proto || $proto;
|
||||||
|
my $self = $class->SUPER::new();
|
||||||
|
$self->over(46);
|
||||||
|
return bless $self, $class;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub as_string
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
return $self->SUPER::as_string($frogs);
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
40
cows/MechAndCow.pm
Normal file
40
cows/MechAndCow.pm
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
package Acme::Cow::MechAndCow;
|
||||||
|
use strict;
|
||||||
|
use Acme::Cow;
|
||||||
|
@Acme::Cow::MechAndCow::ISA = qw(Acme::Cow);
|
||||||
|
my $mech_and_cow = <<'EOC';
|
||||||
|
{$balloon}
|
||||||
|
{$tl} ,-----.
|
||||||
|
{$tl} | |
|
||||||
|
{$tl} ,--| |-.
|
||||||
|
__,----| | | |
|
||||||
|
,;:: | `_____' |
|
||||||
|
`._______| i^i |
|
||||||
|
`----| |---'| .
|
||||||
|
,-------._| |== ||//
|
||||||
|
| |_|P`. /'/
|
||||||
|
`-------' 'Y Y/'/'
|
||||||
|
.==\ /_\
|
||||||
|
^__^ / /'| `i
|
||||||
|
({$el}{$er})\_______ /' / | |
|
||||||
|
(__)\ )\/\ /' / | `i
|
||||||
|
{$U} ||----w | ___,;`----'.___L_,-'`\__
|
||||||
|
|| || i_____;----\.____i""\____\
|
||||||
|
EOC
|
||||||
|
|
||||||
|
sub new
|
||||||
|
{
|
||||||
|
my $proto = shift;
|
||||||
|
my $class = ref $proto || $proto;
|
||||||
|
my $self = $class->SUPER::new();
|
||||||
|
$self->over(10);
|
||||||
|
return bless $self, $class;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub as_string
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
return $self->SUPER::as_string($mech_and_cow);
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
38
cows/Stegosaurus.pm
Normal file
38
cows/Stegosaurus.pm
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
package Acme::Cow::Stegosaurus;
|
||||||
|
use strict;
|
||||||
|
use Acme::Cow;
|
||||||
|
@Acme::Cow::Stegosaurus::ISA = qw(Acme::Cow);
|
||||||
|
my $stegosaurus = <<'EOC';
|
||||||
|
{$balloon}
|
||||||
|
{$tr} . .
|
||||||
|
{$tr} / `. .' "
|
||||||
|
{$tr} .---. < > < > .---.
|
||||||
|
| \ \ - ~ ~ - / / |
|
||||||
|
_____ ..-~ ~-..-~
|
||||||
|
| | \~~~\.' `./~~~/
|
||||||
|
--------- \__/ \__/
|
||||||
|
.' O \ / / \ "
|
||||||
|
(_____, `._.' | \} \/~~~/
|
||||||
|
`----. / \} | / \__/
|
||||||
|
`-. | / | / `. ,~~|
|
||||||
|
~-.__| /_ - ~ ^| /- _ `..-'
|
||||||
|
| / | / ~-. `-. _ _ _
|
||||||
|
|_____| |_____| ~ - . _ _ _ _ _>
|
||||||
|
EOC
|
||||||
|
|
||||||
|
sub new
|
||||||
|
{
|
||||||
|
my $proto = shift;
|
||||||
|
my $class = ref $proto || $proto;
|
||||||
|
my $self = $class->SUPER::new();
|
||||||
|
$self->over(20);
|
||||||
|
return bless $self, $class;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub as_string
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
return $self->SUPER::as_string($stegosaurus);
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
207
cows/TextBalloon.pm
Normal file
207
cows/TextBalloon.pm
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
package Acme::Cow::TextBalloon;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my $rcs_id = q$Id$;
|
||||||
|
|
||||||
|
=pod
|
||||||
|
|
||||||
|
=head1 NAME
|
||||||
|
|
||||||
|
Acme::Cow::TextBalloon - A balloon of text
|
||||||
|
|
||||||
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
use Acme::Cow::TextBalloon;
|
||||||
|
|
||||||
|
$x = new Acme::Cow::TextBalloon;
|
||||||
|
$x->add("bunch of text");
|
||||||
|
$x->wrapcolumn(29);
|
||||||
|
|
||||||
|
$y = new Acme::Cow::TextBalloon;
|
||||||
|
$y->adjust(0);
|
||||||
|
$y->add("more text");
|
||||||
|
|
||||||
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
|
C<Acme::Cow::TextBalloon> Creates and manipulates balloons of text,
|
||||||
|
optionally printing them. One may notice that the methods in this
|
||||||
|
module are named very similarly to those in C<Acme::Cow>; that's
|
||||||
|
because most of them have to do with the balloon rather than the
|
||||||
|
cow.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
use Text::Tabs;
|
||||||
|
use Text::Wrap;
|
||||||
|
|
||||||
|
|
||||||
|
sub new
|
||||||
|
{
|
||||||
|
my $proto = shift;
|
||||||
|
my $class = ref $proto || $proto;
|
||||||
|
my $self = {
|
||||||
|
fill => 1,
|
||||||
|
mode => 'say',
|
||||||
|
over => 0,
|
||||||
|
text => [ ],
|
||||||
|
wrap => 40,
|
||||||
|
};
|
||||||
|
return bless $self, $class;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub wrapcolumn
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
if (@_) {
|
||||||
|
$self->{'wrap'} = $_[0];
|
||||||
|
}
|
||||||
|
return $self->{'wrap'};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub mode
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
return $self->{'mode'};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub think
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
$self->{'mode'} = "think";
|
||||||
|
}
|
||||||
|
|
||||||
|
sub say
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
$self->{'mode'} = "say";
|
||||||
|
}
|
||||||
|
|
||||||
|
sub print
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
$self->{'mode'} = "think";
|
||||||
|
}
|
||||||
|
|
||||||
|
sub adjust
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
if (@_) {
|
||||||
|
$self->{'fill'} = $_[0];
|
||||||
|
}
|
||||||
|
return $self->{'fill'};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub over
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
if (@_) {
|
||||||
|
$self->{'over'} = $_[0];
|
||||||
|
}
|
||||||
|
return $self->{'over'};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub as_list
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
return $self->_construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
sub as_string
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
return join('', $self->_construct());
|
||||||
|
}
|
||||||
|
|
||||||
|
sub add
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
push @{$self->{'text'}}, @_;
|
||||||
|
return $self->{'text'};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub text
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
if (@_) {
|
||||||
|
my @l = @_;
|
||||||
|
$self->{'text'} = \@l;
|
||||||
|
}
|
||||||
|
return $self->{'text'};
|
||||||
|
}
|
||||||
|
|
||||||
|
sub _maxlength
|
||||||
|
{
|
||||||
|
my ($len, $max);
|
||||||
|
$max = -1;
|
||||||
|
for my $i (@_) {
|
||||||
|
$len = length $i;
|
||||||
|
$max = $len if ($len > $max);
|
||||||
|
}
|
||||||
|
return $max;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub _fill_text
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
for my $i (@{$self->{'text'}}) {
|
||||||
|
$i =~ s/\s+$//;
|
||||||
|
}
|
||||||
|
$Text::Tabs::tabstop = 8;
|
||||||
|
my @expanded = Text::Tabs::expand(@{$self->{'text'}});
|
||||||
|
unless ($self->{'fill'}) {
|
||||||
|
return @expanded;
|
||||||
|
}
|
||||||
|
$Text::Wrap::columns = $self->{'wrap'};
|
||||||
|
my @filled = split("\n", Text::Wrap::wrap("", "", @expanded));
|
||||||
|
$Text::Tabs::tabstop = 2; # Defeat a dumb heuristic.
|
||||||
|
my @final = expand(@filled);
|
||||||
|
return @final;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub _construct
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
my $mode = $self->{'mode'};
|
||||||
|
my @message = $self->_fill_text();
|
||||||
|
my $max = _maxlength(@message);
|
||||||
|
my $max2 = $max + 2; ## border space fudge.
|
||||||
|
my @border; ## up-left, up-right, down-left, down-right, left, right
|
||||||
|
my @balloon_lines = ();
|
||||||
|
my $shove = " " x $self->{'over'};
|
||||||
|
my $format = "$shove%s %-${max}s %s\n";
|
||||||
|
if ($mode eq think) {
|
||||||
|
@border = qw[ ( ) ( ) ( ) ];
|
||||||
|
} elsif (@message < 2) {
|
||||||
|
@border = qw[ < > ];
|
||||||
|
} else {
|
||||||
|
@border = ( "/", "\\", "\\", "/", "|", "|" );
|
||||||
|
}
|
||||||
|
push(@balloon_lines,
|
||||||
|
"$shove " . ("_" x $max2) . "\n" ,
|
||||||
|
sprintf($format, $border[0], $message[0], $border[1]),
|
||||||
|
(@message < 2 ? "" :
|
||||||
|
map { sprintf($format, $border[4], $_, $border[5]) }
|
||||||
|
@message[1 .. $#message - 1]),
|
||||||
|
(@message < 2 ? "" :
|
||||||
|
sprintf($format, $border[2], $message[$#message], $border[3])),
|
||||||
|
"$shove " . ("-" x $max2) . "\n"
|
||||||
|
);
|
||||||
|
return @balloon_lines;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
=pod
|
||||||
|
|
||||||
|
=head1 AUTHOR
|
||||||
|
|
||||||
|
Tony Monroe E<lt>tmonroe+perl@nog.netE<gt>
|
||||||
|
|
||||||
|
=head1 SEE ALSO
|
||||||
|
|
||||||
|
L<Acme::Cow>
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
1;
|
||||||
|
__END__
|
43
cows/TuxStab.pm
Normal file
43
cows/TuxStab.pm
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package Acme::Cow::TuxStab;
|
||||||
|
use strict;
|
||||||
|
use Acme::Cow;
|
||||||
|
@Acme::Cow::TuxStab::ISA = qw(Acme::Cow);
|
||||||
|
my $tux_being_stabbed = <<'EOC';
|
||||||
|
{$balloon}
|
||||||
|
{$tl} , ,
|
||||||
|
{$tl} /( )`
|
||||||
|
{$tl} \ \___ / |
|
||||||
|
/- _ `-/ '
|
||||||
|
(/\/ \ \ /\
|
||||||
|
/ / | ` \
|
||||||
|
O O ) / |
|
||||||
|
`-^--'`< '
|
||||||
|
.--. (_.) _ ) /
|
||||||
|
|o_o | `.___/` /
|
||||||
|
|:_/ | `-----' /
|
||||||
|
//<- \ \----. __ / __ \
|
||||||
|
(| <- | )---|====O)))==) \) /====
|
||||||
|
/'\ <- _/`\---' `--' `.__,' \
|
||||||
|
\___)=(___/ | |
|
||||||
|
\ /
|
||||||
|
______( (_ / \______
|
||||||
|
,' ,-----' | \
|
||||||
|
`--\{__________) \/
|
||||||
|
EOC
|
||||||
|
|
||||||
|
sub new
|
||||||
|
{
|
||||||
|
my $proto = shift;
|
||||||
|
my $class = ref $proto || $proto;
|
||||||
|
my $self = $class->SUPER::new();
|
||||||
|
$self->over(8);
|
||||||
|
return bless $self, $class;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub as_string
|
||||||
|
{
|
||||||
|
my $self = shift;
|
||||||
|
return $self->SUPER::as_string($tux_being_stabbed);
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
29
cows/blowfish.cow
Normal file
29
cows/blowfish.cow
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
##
|
||||||
|
## Blowfish
|
||||||
|
##
|
||||||
|
$the_cow = <<EOC;
|
||||||
|
$thoughts
|
||||||
|
$thoughts
|
||||||
|
| .
|
||||||
|
. |L /|
|
||||||
|
_ . |\\ _| \\--+._/| .
|
||||||
|
/ ||\\| Y J ) / |/| ./
|
||||||
|
J |)'( | ` F`.'/
|
||||||
|
-<| F __ .-<
|
||||||
|
| / .-'. `. /-. L___
|
||||||
|
J \\ < \\ | | O\\|.-'
|
||||||
|
_J \\ .- \\/ O | | \\ |F
|
||||||
|
'-F -<_. \\ .-' `-' L__
|
||||||
|
__J _ _. >-' )._. |-'
|
||||||
|
`-|.' /_. \\_| F
|
||||||
|
/.- . _.<
|
||||||
|
/' /.' .' `\\
|
||||||
|
/L /' |/ _.-'-\\
|
||||||
|
/'J ___.---'\\|
|
||||||
|
|\\ .--' V | `. `
|
||||||
|
|/`. `-. `._)
|
||||||
|
/ .-.\\
|
||||||
|
VK \\ ( `\\
|
||||||
|
`.\\
|
||||||
|
|
||||||
|
EOC
|
@@ -7,7 +7,7 @@ $the_cow = <<EOC;
|
|||||||
$thoughts |\\___/| / \\// .\\
|
$thoughts |\\___/| / \\// .\\
|
||||||
$thoughts /O O \\__ / // | \\ \\ *----*
|
$thoughts /O O \\__ / // | \\ \\ *----*
|
||||||
/ / \\/_/ // | \\ \\ \\ |
|
/ / \\/_/ // | \\ \\ \\ |
|
||||||
@___@` \\/_ // | \\ \\ \\/\\ \\
|
\@___\@` \\/_ // | \\ \\ \\/\\ \\
|
||||||
0/0/| \\/_ // | \\ \\ \\ \\
|
0/0/| \\/_ // | \\ \\ \\ \\
|
||||||
0/0/0/0/| \\/// | \\ \\ | |
|
0/0/0/0/| \\/// | \\ \\ | |
|
||||||
0/0/0/0/0/_|_ / ( // | \\ _\\ | /
|
0/0/0/0/0/_|_ / ( // | \\ _\\ | /
|
||||||
|
16
cows/tux.cow
Normal file
16
cows/tux.cow
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
##
|
||||||
|
## TuX
|
||||||
|
## (c) pborys@p-soft.silesia.linux.org.pl
|
||||||
|
##
|
||||||
|
$the_cow = <<EOC;
|
||||||
|
$thoughts
|
||||||
|
$thoughts
|
||||||
|
.--.
|
||||||
|
|o_o |
|
||||||
|
|:_/ |
|
||||||
|
// \\ \\
|
||||||
|
(| | )
|
||||||
|
/'\\_ _/`\\
|
||||||
|
\\___)=(___/
|
||||||
|
|
||||||
|
EOC
|
45
cowsay
45
cowsay
@@ -1,23 +1,40 @@
|
|||||||
#!/usr/bin/perl -w
|
#%BANGPERL%
|
||||||
|
|
||||||
##
|
##
|
||||||
## Cowsay 3.0
|
## Cowsay 3.03
|
||||||
## Tony Monroe, 13 April 1999
|
##
|
||||||
|
## This file is part of cowsay. (c) 1999-2000 Tony Monroe.
|
||||||
##
|
##
|
||||||
|
|
||||||
use Text::Wrap qw(wrap fill $columns $tabstop);
|
use Text::Tabs qw(expand);
|
||||||
|
use Text::Wrap qw(wrap fill $columns);
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
use Getopt::Std;
|
use Getopt::Std;
|
||||||
use Cwd;
|
use Cwd;
|
||||||
|
|
||||||
$version = "3.0";
|
$version = "3.03";
|
||||||
$progname = basename($0);
|
$progname = basename($0);
|
||||||
$eyes = "oo";
|
$eyes = "oo";
|
||||||
$tongue = " ";
|
$tongue = " ";
|
||||||
$wrap = 40;
|
$cowpath = $ENV{'COWPATH'} || '%PREFIX%/share/cows';
|
||||||
$cowpath = $ENV{'COWPATH'} || '/usr/local/share/cows';
|
|
||||||
@message = ();
|
@message = ();
|
||||||
$thoughts = "";
|
$thoughts = "";
|
||||||
|
|
||||||
|
## Yeah, this is rude, I know. But hopefully it gets around a nasty
|
||||||
|
## little version dependency.
|
||||||
|
|
||||||
|
$Text::Wrap::initial_tab = 8;
|
||||||
|
$Text::Wrap::subsequent_tab = 8;
|
||||||
|
$Text::Wrap::tabstop = 8;
|
||||||
|
|
||||||
|
## One of these days, we'll get it ported to Windows. Yeah, right.
|
||||||
|
|
||||||
|
if (($^O eq "MSWin32") or ($^O eq "Windows_NT")) { ## Many perls, eek!
|
||||||
|
$pathsep = ';';
|
||||||
|
} else {
|
||||||
|
$pathsep = ':';
|
||||||
|
}
|
||||||
|
|
||||||
%opts = (
|
%opts = (
|
||||||
'e' => 'oo',
|
'e' => 'oo',
|
||||||
'f' => 'default.cow',
|
'f' => 'default.cow',
|
||||||
@@ -44,9 +61,9 @@ $tongue = substr($opts{'T'}, 0, 2);
|
|||||||
$the_cow = "";
|
$the_cow = "";
|
||||||
|
|
||||||
&slurp_input;
|
&slurp_input;
|
||||||
$columns = $opts{'W'};
|
$Text::Wrap::columns = $opts{'W'};
|
||||||
$tabstop = 8;
|
@message = ($opts{'n'} ? expand(@message) :
|
||||||
@message = ($opts{'n'} ? @message : split("\n", fill("", "", @message)));
|
split("\n", fill("", "", @message)));
|
||||||
&construct_balloon;
|
&construct_balloon;
|
||||||
&construct_face;
|
&construct_face;
|
||||||
&get_cow;
|
&get_cow;
|
||||||
@@ -57,7 +74,7 @@ sub list_cowfiles {
|
|||||||
my $basedir;
|
my $basedir;
|
||||||
my @dirfiles;
|
my @dirfiles;
|
||||||
chop($basedir = cwd);
|
chop($basedir = cwd);
|
||||||
for my $d (split(/:/, $cowpath)) {
|
for my $d (split(/$pathsep/, $cowpath)) {
|
||||||
print "Cow files in $d:\n";
|
print "Cow files in $d:\n";
|
||||||
opendir(COWDIR, $d) || die "$0: Cannot open $d\n";
|
opendir(COWDIR, $d) || die "$0: Cannot open $d\n";
|
||||||
for my $file (readdir COWDIR) {
|
for my $file (readdir COWDIR) {
|
||||||
@@ -105,7 +122,11 @@ sub construct_balloon {
|
|||||||
@border = qw[ < > ];
|
@border = qw[ < > ];
|
||||||
} else {
|
} else {
|
||||||
$thoughts = '\\';
|
$thoughts = '\\';
|
||||||
|
if ($V and $V gt v5.6.0) { # Thanks, perldelta.
|
||||||
@border = qw[ / \\ \\ / | | ];
|
@border = qw[ / \\ \\ / | | ];
|
||||||
|
} else {
|
||||||
|
@border = qw[ / \ \ / | | ];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
push(@balloon_lines,
|
push(@balloon_lines,
|
||||||
" " . ("_" x $max2) . " \n" ,
|
" " . ("_" x $max2) . " \n" ,
|
||||||
@@ -159,7 +180,7 @@ sub get_cow {
|
|||||||
|
|
||||||
sub display_usage {
|
sub display_usage {
|
||||||
die <<EOF;
|
die <<EOF;
|
||||||
cow{say,think} version $version, (c) 1999 Tony's SquidWarez
|
cow{say,think} version $version, (c) 1999 Tony Monroe
|
||||||
Usage: $progname [-bdgpstwy] [-h] [-e eyes] [-f cowfile]
|
Usage: $progname [-bdgpstwy] [-h] [-e eyes] [-f cowfile]
|
||||||
[-l] [-n] [-T tongue] [-W wrapcolumn] [message]
|
[-l] [-n] [-T tongue] [-W wrapcolumn] [message]
|
||||||
EOF
|
EOF
|
||||||
|
192
cowsay.1
192
cowsay.1
@@ -1,44 +1,58 @@
|
|||||||
.so /usr/local/etc/nmh/tmac.h
|
.\"
|
||||||
.TH COWSAY 1 "Barnyard Animal Management"
|
.\" cowsay.1
|
||||||
|
.\"
|
||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.\" This file is part of cowsay. (c) 1999 Tony Monroe.
|
||||||
|
.\"
|
||||||
|
.ds Nm Cowsay
|
||||||
|
.ds nm cowsay
|
||||||
|
.ds Vn 3.02
|
||||||
|
.TH \*(nm 1 "$Date$"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
cowsay, cowthink \- configurable speaking/thinking cow
|
\*(nm/cowthink \- configurable speaking/thinking cow (and a bit more)
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
cowsay
|
cowsay
|
||||||
\%[\-e eye_string]
|
.RB [ \-e
|
||||||
\%[\-f cowfile]
|
.IR eye_string ]
|
||||||
\%[\-h]
|
.RB [ \-f
|
||||||
\%[\-l]
|
.IR cowfile ]
|
||||||
\%[\-n]
|
.RB [ \-h ]
|
||||||
\%[\-T tongue_string]
|
.RB [ \-l ]
|
||||||
\%[\-W column]
|
.RB [ \-n ]
|
||||||
\%[\-bdgpstwy]
|
.RB [ \-T
|
||||||
|
.IR tongue_string ]
|
||||||
|
.RB [ \-W
|
||||||
|
.IR column ]
|
||||||
|
.RB [ \-bdgpstwy ]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.I Cowsay
|
.I Cowsay
|
||||||
generates an ASCII picture of a cow saying something provided by the
|
generates an ASCII picture of a cow saying something provided by the
|
||||||
user. If run with no arguments, it accepts standard input, word-wraps
|
user. If run with no arguments, it accepts standard input, word-wraps
|
||||||
the message given at about 40 columns, and prints the cow saying the
|
the message given at about 40 columns, and prints the cow saying the
|
||||||
given message on standard output.
|
given message on standard output.
|
||||||
|
.PP
|
||||||
To aid in the use of arbitrary messages with arbitrary whitespace, use the
|
To aid in the use of arbitrary messages with arbitrary whitespace,
|
||||||
.B -n
|
use the
|
||||||
option. If it is specified, the given message will not
|
.B \-n
|
||||||
be word-wrapped. This is possibly useful if you want to make the cow
|
option. If it is specified, the given message will not be
|
||||||
|
word-wrapped. This is possibly useful if you want to make the cow
|
||||||
think or speak in figlet(6). If
|
think or speak in figlet(6). If
|
||||||
.B -n
|
.B \-n
|
||||||
is specified, there must not be any command-line arguments left after
|
is specified, there must not be any command-line arguments left
|
||||||
all the switches have been processed.
|
after all the switches have been processed.
|
||||||
|
.PP
|
||||||
The
|
The
|
||||||
.B -W
|
.B \-W
|
||||||
specifies roughly (where the message should be wrapped. The default is
|
specifies roughly (where the message should be wrapped. The default
|
||||||
equivalent to
|
is equivalent to
|
||||||
.B -W 40
|
.B \-W 40
|
||||||
i.e. wrap words at or before the 40th column.
|
i.e. wrap words at or before the 40th column.
|
||||||
|
.PP
|
||||||
If any command-line arguments are left over after all switches have
|
If any command-line arguments are left over after all switches have
|
||||||
been processed, they become the cow\'s message. The program will not
|
been processed, they become the cow's message. The program will not
|
||||||
accept standard input for a message in this case.
|
accept standard input for a message in this case.
|
||||||
|
.PP
|
||||||
There are several provided modes which change the appearance of the
|
There are several provided modes which change the appearance of the
|
||||||
cow depending on its particular emotional/physical state. The
|
cow depending on its particular emotional/physical state. The
|
||||||
.B \-b
|
.B \-b
|
||||||
@@ -54,79 +68,101 @@ makes the cow appear thoroughly stoned;
|
|||||||
.B \-t
|
.B \-t
|
||||||
yields a tired cow;
|
yields a tired cow;
|
||||||
.B \-w
|
.B \-w
|
||||||
is somewhat the opposite of \-t, and initiates wired mode;
|
is somewhat the opposite of
|
||||||
|
.BR \-t ,
|
||||||
|
and initiates wired mode;
|
||||||
.B \-y
|
.B \-y
|
||||||
brings on the cow's youthful appearance.
|
brings on the cow's youthful appearance.
|
||||||
|
.PP
|
||||||
The user may specify the
|
The user may specify the
|
||||||
.B -e
|
.B \-e
|
||||||
option to select the appearance of the cow's eyes, in which
|
option to select the appearance of the cow's eyes, in which case
|
||||||
case the first two characters of the argument string
|
the first two characters of the argument string
|
||||||
.B eye_string
|
.I eye_string
|
||||||
will be used. The default eyes are 'oo'. The tongue is similarly
|
will be used. The default eyes are 'oo'. The tongue is similarly
|
||||||
configurable through
|
configurable through
|
||||||
.B -T
|
.B \-T
|
||||||
and
|
and
|
||||||
.B tongue_string;
|
.IR tongue_string ;
|
||||||
it must be two characters and does not appear by
|
it must be two characters and does not appear by default. However,
|
||||||
default. However, it does appear in the 'dead' and 'stoned' modes.
|
it does appear in the 'dead' and 'stoned' modes. Any configuration
|
||||||
Any configuration done by
|
done by
|
||||||
.B -e
|
.B \-e
|
||||||
and
|
and
|
||||||
.B -T
|
.B \-T
|
||||||
will be lost if one of the provided modes is used.
|
will be lost if one of the provided modes is used.
|
||||||
|
.PP
|
||||||
The
|
The
|
||||||
.B -f
|
.B \-f
|
||||||
option specifies a particular cow picture file (``cowfile'') to
|
option specifies a particular cow picture file (``cowfile'') to
|
||||||
use. If the cowfile spec contains / then it will be interpreted
|
use. If the cowfile spec contains '/' then it will be interpreted
|
||||||
as a path relative to the current directory. Otherwise, cowsay
|
as a path relative to the current directory. Otherwise, cowsay
|
||||||
will search the path specified in the COWPATH environment variable.
|
will search the path specified in the
|
||||||
To list all cowfiles on the current $COWPATH, invoke
|
.B COWPATH
|
||||||
.B cowsay
|
environment variable.
|
||||||
|
To list all cowfiles on the current
|
||||||
|
.BR COWPATH ,
|
||||||
|
invoke
|
||||||
|
.B \*(nm
|
||||||
with the
|
with the
|
||||||
.B -l
|
.B \-l
|
||||||
switch.
|
switch.
|
||||||
|
.PP
|
||||||
If the program is invoked as
|
If the program is invoked as
|
||||||
.B cowthink
|
.B cowthink
|
||||||
then the cow will think its message instead of saying it.
|
then the cow will think its message instead of saying it.
|
||||||
|
.PP
|
||||||
.SH COWFILE FORMAT
|
.SH COWFILE FORMAT
|
||||||
A cowfile is made up of a simple block of perl(1) code, which
|
A cowfile is made up of a simple block of
|
||||||
assigns a picture of a cow to the variable ``$the_cow''. Should
|
.BR perl (1)
|
||||||
you wish to customize the eyes or the tongue of the cow, then the
|
code, which assigns a picture of a cow to the variable
|
||||||
variables ``$eyes'' and ``$tongue'' may be used. The trail leading
|
.BR $the_cow .
|
||||||
up to the cow\'s message balloon is composed of the character(s)
|
Should you wish to customize the eyes or the tongue of the cow,
|
||||||
in the ``$thoughts'' variable. Any backslashes must be reduplicated
|
then the variables
|
||||||
to prevent interpolation. The name of a cowfile should end with
|
.B $eyes
|
||||||
``.cow'', otherwise it is assumed not to be a cowfile. Also,
|
and
|
||||||
at-signs (``@'') must be backslashed because that is what Perl 5
|
.B $tongue
|
||||||
expects.
|
may be used. The trail leading up to the cow's message balloon is
|
||||||
|
composed of the character(s) in the
|
||||||
|
.B $thoughts
|
||||||
|
variable. Any backslashes must be reduplicated to prevent
|
||||||
|
interpolation. The name of a cowfile should end with
|
||||||
|
.BR .cow ,
|
||||||
|
otherwise it is assumed not to be a cowfile. Also, at-signs (``@'')
|
||||||
|
must be backslashed because that is what Perl 5 expects.
|
||||||
|
.PP
|
||||||
.SH COMPATIBILITY WITH OLDER VERSIONS
|
.SH COMPATIBILITY WITH OLDER VERSIONS
|
||||||
Version 3.0 is fully backward-compatible with 2.x versions. If
|
.PP
|
||||||
you're still using a 1.x version, consider upgrading.
|
What older versions? :-)
|
||||||
|
.PP
|
||||||
|
Version 3.x is fully backward-compatible with 2.x versions. If
|
||||||
|
you're still using a 1.x version, consider upgrading. And tell me
|
||||||
|
where you got the older versions, since I didn't exactly put them
|
||||||
|
up for world-wide access.
|
||||||
|
.PP
|
||||||
|
Oh, just so you know, this manual page documents version \*(Vn of
|
||||||
|
cowsay.
|
||||||
.SH ENVIRONMENT
|
.SH ENVIRONMENT
|
||||||
The COWPATH environment variable, if present, will be used to search
|
The COWPATH environment variable, if present, will be used to search
|
||||||
for cowfiles. It contains a colon-separated list of directories,
|
for cowfiles. It contains a colon-separated list of directories,
|
||||||
much like PATH or MANPATH. It should always contain the
|
much like
|
||||||
/usr/local/share/cows directory, or at least a directory with a
|
.B PATH or
|
||||||
file called ``default.cow'' in it.
|
.BR MANPATH .
|
||||||
|
It should always contain the
|
||||||
|
.B /usr/local/share/cows
|
||||||
|
directory, or at least a directory with a file called
|
||||||
|
.B default.cow
|
||||||
|
in it.
|
||||||
.SH FILES
|
.SH FILES
|
||||||
/usr/local/share/cows holds a sample set of cowfiles. If your
|
.B %PREFIX%/share/cows
|
||||||
COWPATH is not explicitly set, it automatically contains this directory.
|
holds a sample set of cowfiles. If your
|
||||||
|
.B COWPATH
|
||||||
|
is not explicitly set, it automatically contains this directory.
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
If there are any left, please notify the author at the address below.
|
If there are any, please notify the author at the address below.
|
||||||
|
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
Tony Monroe (tmonroe@csua.berkeley.edu), with suggestions from Shannon
|
Tony Monroe (tony@nog.net), with suggestions from Shannon
|
||||||
Appel (appel@csua.berkeley.edu) and contributions from Anthony Polito
|
Appel (appel@CSUA.Berkeley.EDU) and contributions from Anthony Polito
|
||||||
(aspolito@csua.berkeley.edu).
|
(aspolito@CSUA.Berkeley.EDU).
|
||||||
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
perl(1), wall(1), nwrite(1), figlet(6), /csua/bin/rootcow
|
perl(1), wall(1), nwrite(1), figlet(6)
|
||||||
|
|
||||||
|
92
install.sh
Executable file
92
install.sh
Executable file
@@ -0,0 +1,92 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
##
|
||||||
|
## install.sh
|
||||||
|
##
|
||||||
|
## Installation script for cowsay.
|
||||||
|
##
|
||||||
|
## $Id$
|
||||||
|
##
|
||||||
|
## This file is part of cowsay. (c) 1999 Tony Monroe.
|
||||||
|
##
|
||||||
|
|
||||||
|
rcs_id='$Id$'
|
||||||
|
|
||||||
|
filelist='cows'
|
||||||
|
|
||||||
|
cat <<DOG
|
||||||
|
===================
|
||||||
|
cowsay Installation
|
||||||
|
===================
|
||||||
|
|
||||||
|
Searching for useful perl executables...
|
||||||
|
DOG
|
||||||
|
|
||||||
|
backdoor=$1
|
||||||
|
|
||||||
|
pathdirs=`echo $PATH | tr : " "`
|
||||||
|
for p in $pathdirs; do
|
||||||
|
set $p/perl $p/perl5*
|
||||||
|
while [ ! -z "$1" ]; do
|
||||||
|
if [ -x "$1" ]; then
|
||||||
|
echo Found perl in $1
|
||||||
|
perls="$perls $1"
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
done
|
||||||
|
for perl in $perls; do
|
||||||
|
if $perl -MText::Wrap -e0 >/dev/null 2>&1; then
|
||||||
|
echo Found a good perl in $perl
|
||||||
|
goodperls="$goodperls $perl"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo The following perl executables will run cowsay:
|
||||||
|
echo $goodperls
|
||||||
|
echo I recommend the latest stable perl you can find.
|
||||||
|
set $goodperls
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo Ack! You do not have Perl 5 installed correctly!
|
||||||
|
echo Get thee to CPAN!
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
usethisperl=$1
|
||||||
|
echo I will be using $1 because I know it will work.
|
||||||
|
|
||||||
|
echo Now I need an installation prefix. I will use /usr/local unless
|
||||||
|
printf "you give me a better idea here: "
|
||||||
|
if [ -n "$backdoor" ]; then
|
||||||
|
prefix=$backdoor
|
||||||
|
printf "%s (specified on command line)\n" $prefix
|
||||||
|
else
|
||||||
|
read prefix
|
||||||
|
fi
|
||||||
|
|
||||||
|
PREFIX=${prefix:-/usr/local}
|
||||||
|
|
||||||
|
echo Okay, time to install this puppy.
|
||||||
|
|
||||||
|
echo s,%BANGPERL%,!$usethisperl,\; > install.pl
|
||||||
|
echo s,%PREFIX%,$PREFIX,\; >> install.pl
|
||||||
|
set -x
|
||||||
|
mkdir -p $PREFIX/bin || (mkdir $PREFIX; mkdir $PREFIX/bin)
|
||||||
|
$usethisperl -p install.pl cowsay > $PREFIX/bin/cowsay
|
||||||
|
chmod a+x $PREFIX/bin/cowsay
|
||||||
|
ln -s cowsay $PREFIX/bin/cowthink
|
||||||
|
mkdir -p $PREFIX/man/man1 || ($mkdir $PREFIX; mkdir $PREFIX/man; mkdir $PREFIX/man/man1)
|
||||||
|
$usethisperl -p install.pl cowsay.1 > $PREFIX/man/man1/cowsay.1
|
||||||
|
chmod a+r $PREFIX/man/man1/cowsay.1
|
||||||
|
ln -s cowsay.1 $PREFIX/man/man1/cowthink.1
|
||||||
|
mkdir -p $PREFIX/share/cows || (mkdir $PREFIX; mkdir $PREFIX/share; mkdir $PREFIX/share/cows)
|
||||||
|
tar -cf - $filelist | (cd $PREFIX/share && tar -xvf -)
|
||||||
|
set +x
|
||||||
|
|
||||||
|
echo Okay, let us see if the install actually worked.
|
||||||
|
|
||||||
|
if [ ! -f $PREFIX/share/cows/default.cow ]; then
|
||||||
|
echo The default cow file did not make it across!
|
||||||
|
echo Ooops, it failed...sorry!
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo Installation complete! Enjoy the cows!
|
Reference in New Issue
Block a user