Skip to content

Commit c6198fa

Browse files
committed
Merge pull request #41 from schinckel/patch-3
Use stdin if not a tty (or --wait is provided)
2 parents 690072b + 9139c41 commit c6198fa

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

rmate

+13-2
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,19 @@ done
204204
filepath="$1"
205205

206206
if [ "$filepath" = "" ]; then
207-
showusage
208-
exit 1
207+
if [[ $nowait = false ]]; then
208+
filepath='-'
209+
else
210+
case "$-" in
211+
*i*)
212+
showusage
213+
exit 1
214+
;;
215+
*)
216+
filepath='-'
217+
;;
218+
esac
219+
fi
209220
fi
210221

211222
shift

0 commit comments

Comments
 (0)