batches: make `-f` optional
Created by: LawnGnome
New behaviour (assuming COMMAND
is any command that accepted -f
, including apply
, preview
, repos
, or validate
):
-
src batch COMMAND
on a TTY: will wait for 250ms in case there's input on stdin; otherwise errors -
src batch COMMAND
with a file redirected in: waits indefinitely for input -
src batch COMMAND -f -
: waits indefinitely for input -
src batch COMMAND FILE
: reads fromFILE
; equivalent tosrc batch COMMAND -f FILE
-
src batch COMMAND -f FILE
: works as before
In summary, this shouldn't break backward compatibility in any case except for the user slowly typing in a batch spec on stdin.
Fixes #680.