kiss: Abort if not TTY and needed

This commit is contained in:
Dylan Araps 2020-02-29 20:13:47 +02:00
parent 3a5485f36c
commit 2f64b45677
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 5 additions and 0 deletions

5
kiss
View File

@ -1216,6 +1216,11 @@ args() {
die "Arguments contain invalid characters: '!*[]'"
esac
# Abort early if output is not a TTY and the requirement is that it
# be so (password prompts, user input, etc). This is a safeguard.
[ "${action##[bciru]*}" ] || [ -t 1 ] ||
die "Output not a tty"
# Parse some arguments earlier to remove the need to duplicate code.
case $action in
c|checksum|s|search)