kiss: Abort if not TTY and needed
This commit is contained in:
parent
3a5485f36c
commit
2f64b45677
5
kiss
5
kiss
|
@ -1216,6 +1216,11 @@ args() {
|
||||||
die "Arguments contain invalid characters: '!*[]'"
|
die "Arguments contain invalid characters: '!*[]'"
|
||||||
esac
|
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.
|
# Parse some arguments earlier to remove the need to duplicate code.
|
||||||
case $action in
|
case $action in
|
||||||
c|checksum|s|search)
|
c|checksum|s|search)
|
||||||
|
|
Loading…
Reference in New Issue