aboutsummaryrefslogtreecommitdiff
path: root/ponysay
diff options
context:
space:
mode:
authormaandree <maandree@operamail.com>2012-05-08 05:15:06 -0700
committermaandree <maandree@operamail.com>2012-05-08 05:15:06 -0700
commita018192fa0532e6071a0876776756461a4ef08ad (patch)
treee0d4af301879b596371452ec5b014802037aae94 /ponysay
parent3ed997195b7eccf1438311dc332d93a8dce06d19 (diff)
parent40c0f58ca8838cff19d56f6a64bfb2b1c4f28cc1 (diff)
downloadponysay-a018192fa0532e6071a0876776756461a4ef08ad.tar.gz
ponysay-a018192fa0532e6071a0876776756461a4ef08ad.tar.bz2
ponysay-a018192fa0532e6071a0876776756461a4ef08ad.zip
Merge pull request #15 from L-four/master
Print usage and exit when no stdin and no arguments are present
Diffstat (limited to 'ponysay')
-rwxr-xr-xponysay6
1 files changed, 6 insertions, 0 deletions
diff --git a/ponysay b/ponysay
index 345dd0e..e07e1e3 100755
--- a/ponysay
+++ b/ponysay
@@ -45,6 +45,12 @@ Options:
EOF
}
+# if no stdin and no argumrnts then print usage and exit
+if [[ -t 0 && $# == 0 ]]; then
+ usage
+ exit
+fi
+
say() {
# Ponies use UTF-8 drawing characters. Prevent a Perl warning.
export PERL_UNICODE=S