Skip to content

Commit

Permalink
Make options --paper, --*paper and --papersize override preceding ones
Browse files Browse the repository at this point in the history
  • Loading branch information
lemniscati authored and rrthomas committed Apr 27, 2024
1 parent bbdc219 commit f9b86dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/pdfjam
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ if command -v paper >/dev/null ; then
paper='' ## We might not have a LaTeX-compatible name
else
paper='a4paper' ## fallback paper size is ISO A4
papersize='' ## clear papersize
fi
##
## END OF SETTINGS MADE DIRECTLY WITHIN THE SCRIPT
Expand Down Expand Up @@ -460,6 +461,7 @@ while test -n "${1}${2}"; do
shift ;;
--paper)
paper="${2}"
papersize='' ## clear papersize
callOptions="$callOptions ${1} ${2}" ;
shift ;;
--pagecolor)
Expand All @@ -477,9 +479,11 @@ while test -n "${1}${2}"; do
--ansidpaper | --ansiepaper | \
--letterpaper | --legalpaper | --executivepaper)
paper=$(printf "%s" "${1}" | sed 's/^--//') ;
papersize='' ## clear papersize
callOptions="$callOptions ${1}" ;
;;
--papersize)
paper='' ## clear paper
papersize="papersize=${2}" ;
callOptions="$callOptions ${1} '${2}'" ;
shift ;;
Expand Down

0 comments on commit f9b86dc

Please sign in to comment.