mirror of
https://github.com/erkin/ponysay
synced 2024-11-15 08:07:10 +00:00
Merge pull request #15 from L-four/master
Print usage and exit when no stdin and no arguments are present
This commit is contained in:
commit
a018192fa0
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