Skip to content

batches: make -f optional#687

Merged
LawnGnome merged 3 commits into
mainfrom
aharvey/stdin
Feb 1, 2022
Merged

batches: make -f optional#687
LawnGnome merged 3 commits into
mainfrom
aharvey/stdin

Conversation

@LawnGnome

Copy link
Copy Markdown
Contributor

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 from FILE; equivalent to src 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.

@LawnGnome LawnGnome requested a review from a team February 1, 2022 03:53
Comment thread internal/batches/ui/tty.go Outdated
Comment thread cmd/src/batch_common.go
Co-authored-by: Erik Seliger <erikseliger@me.com>
@LawnGnome LawnGnome merged commit ee56d95 into main Feb 1, 2022
@LawnGnome LawnGnome deleted the aharvey/stdin branch February 1, 2022 21:34
scjohns pushed a commit that referenced this pull request Apr 24, 2023
Co-authored-by: Erik Seliger <erikseliger@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants