Skip to content

Commit

Permalink
Use stdin if not a tty (or --wait is provided)
Browse files Browse the repository at this point in the history
This brings it in to line with the ruby version.

Resolves #39.
  • Loading branch information
schinckel committed May 23, 2015
1 parent ec3f140 commit 9139c41
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions rmate
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,19 @@ done
filepath="$1"

if [ "$filepath" = "" ]; then
showusage
exit 1
if [[ $nowait = false ]]; then
filepath='-'
else
case "$-" in
*i*)
showusage
exit 1
;;
*)
filepath='-'
;;
esac
fi
fi

shift
Expand Down

0 comments on commit 9139c41

Please sign in to comment.