mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-22 12:27:59 +01:00
Check for stdin and args
This commit is contained in:
parent
3ed997195b
commit
40c0f58ca8
1 changed files with 6 additions and 0 deletions
6
ponysay
6
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
|
||||
|
|
Loading…
Reference in a new issue