3 #==============================================================================
5 # File ID: 2706f4c0-b7bb-11ee-bb6f-83850402c3ce
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #==============================================================================
23 while test -n "$1"; do
25 -2|
--two-sided) opt_two_sided
=1; shift ;;
26 -P|
--printer) opt_printer
="$2"; shift 2 ;;
27 -h|
--help) opt_help
=1; shift ;;
28 -l|
--landscape) opt_landscape
=1; shift ;;
29 -p|
--pretty) opt_pretty
=1; shift ;;
30 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
31 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
32 --version) echo $progname $VERSION; exit 0 ;;
35 if printf '%s\n' "$1" |
grep -q ^
-; then
36 echo "$progname: $1: Unknown option" >&2
44 opt_verbose
=$
(($opt_verbose - $opt_quiet))
46 if test "$opt_help" = "1"; then
47 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
50 Usage: $progname [options]
55 Print on both pages of the paper.
60 -P DEST, --printer DEST
61 Use DEST as print destination.
63 Create page headers and use syntax highlighting.
65 Be more quiet. Can be repeated to increase silence.
67 Increase level of verbosity. Can be repeated.
69 Print version information.
76 if [ "$opt_pretty" = "1" ]; then
81 if [ -n "$opt_printer" ]; then
82 printer_str
="-P $opt_printer"
86 if [ "$opt_landscape" = "1" ]; then
87 rot_str
="-o orientation-requested=4"
91 if [ "$opt_two_sided" = "1" ]; then
92 if [ "$opt_landscape" = "1" ]; then
93 sides_str
="-o sides=two-sided-short-edge"
95 sides_str
="-o sides=two-sided-long-edge"
108 # vim: set ts=8 sw=8 sts=8 noet fo+=w tw=79 fenc=UTF-8 :