From 40c0f58ca8838cff19d56f6a64bfb2b1c4f28cc1 Mon Sep 17 00:00:00 2001 From: Kyah Rindlisbacher Date: Tue, 8 May 2012 18:04:26 +1000 Subject: [PATCH] Check for stdin and args --- ponysay | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ponysay b/ponysay index 345dd0ee..e07e1e3a 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