From 949156f77c01e9b6f3cbc41de8007417adebb0ef Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Fri, 28 Jan 2022 10:40:56 -0500 Subject: [PATCH] Add usage() --- rem2pdf/bin/rem2pdf | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/rem2pdf/bin/rem2pdf b/rem2pdf/bin/rem2pdf index 342bffd0..126358b0 100755 --- a/rem2pdf/bin/rem2pdf +++ b/rem2pdf/bin/rem2pdf @@ -56,10 +56,47 @@ my $settings = { margin_right => 36, }; +my $me = $0; +$me =~ s/^.*\///; + +sub usage +{ + print <<"EOF"; +$me: Convert Remind -pp output to a PDF calendar. + +Usage: remind -pp [options] filename | $me [options] > out.pdf + +Options: + +--landscape, -l Print in landscape orientation +--small-calendars=N Choose location for small calendars +-c=N Synonym for --small-calendars=N +--left-numbers, -x Print day numbers on the left +--fill-page, -e Fill the entire page +--media=MEDIA, -m=MEDIA Size for specified media +--witdh=W, -w=W Specify media width in 1/72nds of an inch +--height=H, -h=H Specify media height in 1/72nds of an inch +--title-font=FONT Specify font for calendar title +--header-font=FONT Specify font for weekday names +--daynum-font=FONT Specify font for day numbers +--entry-font=FONT Specify font for calendar entries +--small-cal-font=FONT Specify font for small calendars +--title-size=S Specify size of font for calendar title in points +--header-size=S Specify size of font for weekday names +--daynum-size=S Specify size of font for day numbers +--entry-size=S Specify size of font for calendar entries +--border-size=S Specify size of gaps between items in 1/72nds of an inch +--line-thickness=S Specify line thickness in 1/72nds of an inch +--margin-top=S Specify top margin size in 1/72nds of an inch +--margin-bottom=S Specify bottom margin size in 1/72nds of an inch +--margin-left=S Specify left margin size in 1/72nds of an inch +--margin-right=S Specify right margin size in 1/72nds of an inch +EOF +} + my $ret = GetOptions('landscape|l' => \$settings->{landscape}, 'small-calendars|c=i' => \$settings->{small_calendars}, 'left-numbers|x' => \$settings->{numbers_on_left}, - 'fill-entire-page|e' => \$settings->{fill_entire_page}, 'fill-page|e' => \$settings->{fill_entire_page}, 'media|m=s' => \$settings->{media}, 'width|w=i' => \$settings->{width}, @@ -102,9 +139,6 @@ if ($settings->{landscape}) { $settings->{height} = $tmp; } -my $me = $0; -$me =~ s/^.*\///; - # Don't read from a terminal if (-t STDIN) { print STDERR "I can't read data from a terminal. Please run like this:\n";