aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-07-21 03:12:23 -0700
committerMattias Andrée <maandree@operamail.com>2012-07-21 03:12:23 -0700
commitca0fffcd618d23cf00d9ea0959f84323b415085b (patch)
tree2edbd4d1f2e845533a12d831184ecd45eecffd89
parent4cfde927f3dd456d2c4315f7eca6fe65c0f3351f (diff)
parent57fdde2f5e78abf097a0af2249031989de2ef0b5 (diff)
downloadponysay-ca0fffcd618d23cf00d9ea0959f84323b415085b.tar.gz
ponysay-ca0fffcd618d23cf00d9ea0959f84323b415085b.tar.bz2
ponysay-ca0fffcd618d23cf00d9ea0959f84323b415085b.zip
Merge pull request #50 from etu/master
Updated ponysay to support names like "Apple Jack" and list.pl to format those names
-rwxr-xr-xponysay2
-rwxr-xr-xponysaylist.pl4
2 files changed, 5 insertions, 1 deletions
diff --git a/ponysay b/ponysay
index c856fd2..4a73cbe 100755
--- a/ponysay
+++ b/ponysay
@@ -270,7 +270,7 @@ while getopts $opts OPT; do
case ${OPT} in
v) version; exit ;;
h) usage; exit ;;
- f) ponies+=( "$OPTARG" ) ;;
+ f) ponies=($(echo $OPTARG | sed -e 's/ //g' -e 's/,/\n/')) ;;
l) list; exit ;;
L) linklist; exit ;;
W) wrap="$OPTARG" ;;
diff --git a/ponysaylist.pl b/ponysaylist.pl
index 7a09376..72c0a92 100755
--- a/ponysaylist.pl
+++ b/ponysaylist.pl
@@ -15,6 +15,10 @@ $maxw = 1;
foreach $arg (@ARGV)
{
+ # Format names from ponyies names
+ $arg =~ s/([a-z])([A-Z])/\1 \2/;
+ $arg =~ s/_(.*)/\t(\1)/;
+
if ($first == 1)
{ $first = 0;
$scrw = $arg;