From cf74b537d9f13769c48ddea2825228a2cccd3f5c Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 15 Apr 2023 12:03:31 -0300 Subject: bin/print: Only call lpoptions(1) after -h has been processed --- bin/print | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/print b/bin/print index f26831d..9d2b299 100755 --- a/bin/print +++ b/bin/print @@ -107,7 +107,7 @@ for flag in "$@"; do esac done -lpoptions -o PrintQuality=standard +QUALITY_SET=false DUPLEX= while getopts 'dq:h' flag; do case "$flag" in @@ -115,6 +115,7 @@ while getopts 'dq:h' flag; do DUPLEX=1 ;; q) + QUALITY_SET=true case "$OPTARG" in low) lpoptions -o PrintQuality=draft @@ -144,6 +145,10 @@ while getopts 'dq:h' flag; do done shift $((OPTIND - 1)) +if [ "$QUALITY_SET" = false ]; then + lpoptions -o PrintQuality=standard +fi + NEWDIR="$(mkdtemp)" trap 'rm -rf "$NEWDIR"' EXIT if [ -z "${1:-}" ]; then -- cgit v1.2.3