diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-07-21 03:12:23 -0700 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-07-21 03:12:23 -0700 |
commit | ca0fffcd618d23cf00d9ea0959f84323b415085b (patch) | |
tree | 2edbd4d1f2e845533a12d831184ecd45eecffd89 | |
parent | 4cfde927f3dd456d2c4315f7eca6fe65c0f3351f (diff) | |
parent | 57fdde2f5e78abf097a0af2249031989de2ef0b5 (diff) | |
download | ponysay-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-x | ponysay | 2 | ||||
-rwxr-xr-x | ponysaylist.pl | 4 |
2 files changed, 5 insertions, 1 deletions
@@ -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; |