2 # grog - guess options for groff command
3 # Inspired by doctype script in Kernighan & Pike, Unix Programming
4 # Environment, pp 306-8.
6 # Source file position: <groff-source>/src/roff/grog/subs.pl
7 # Installed position: <prefix>/lib/grog/subs.pl
9 # Copyright (C) 1993-2018 Free Software Foundation, Inc.
10 # This file was split from grog.pl and put under GPL2 by
11 # Bernd Warken <groff-bernd.warken-72@web.de>.
12 # The macros for identifying the devices were taken from Ralph
13 # Corderoy's 'grog.sh' of 2006.
15 # Last update: 10 Sep 2015
17 # This file is part of 'grog', which is part of 'groff'.
19 # 'groff' is free software; you can redistribute it and/or modify it
20 # under the terms of the GNU General Public License as published by
21 # the Free Software Foundation, either version 2 of the License, or
22 # (at your option) any later version.
24 # 'groff' is distributed in the hope that it will be useful, but
25 # WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 # General Public License for more details.
29 # You can get the license text for the GNU General Public License
30 # version 2 in the internet at
31 # <http://www.gnu.org/licenses/gpl-2.0.html>.
33 ########################################################################
42 # printing of hashes: my %hash = ...; print Dumper(\%hash);
45 # for running shell based programs within Perl; use `` instead of
46 # use IPC::System::Simple qw(capture capturex run runx system systemx);
50 # my $Sp = "[\\s\\n]";
51 # my $Sp = qr([\s\n]);
52 # my $Sp = '' if $arg eq '-C';
55 # from 'src/roff/groff/groff.cpp' near 'getopt_long'
57 'abcCd:D:eEf:F:gGhiI:jJkK:lL:m:M:n:No:pP:r:RsStT:UvVw:W:XzZ';
59 my @Command = (); # stores the final output
60 my @Mparams = (); # stores the options '-m*'
61 my @devices = (); # stores -T
63 my $do_run = 0; # run generated 'groff' command
64 my $pdf_with_ligatures = 0; # '-P-y -PU' for 'pdf' device
65 my $with_warnings = 0;
69 my ($v, $d, $f) = File::Spec->splitpath($Prog);
88 'PS' => 0, # opening for pic
89 'PF' => 0, # alternative opening for pic
90 'PE' => 0, # closing for pic
114 'TH_later' => 0, # TH not 1st command is ms
119 'IP' => 0, # man and ms
120 'LP' => 0, # man and ms
121 'P' => 0, # man and ms
122 'PP' => 0, # man and ms
123 'SH' => 0, # man and ms
128 'TH_first' => 0, # TH as 1st command is man
133 # for mdoc and mdoc-old
134 # .Oo and .Oc for modern mdoc, only .Oo for mdoc-old
135 'Oo' => 0, # mdoc and mdoc-old
141 # for first line check
174 ########################################################################
176 ########################################################################
184 ########################################################################
186 ########################################################################
189 my $double_minus = 0;
193 # globals: @filespec, @Command, @devices, @Mparams
195 foreach my $arg (@ARGV) {
203 if ( $double_minus ) {
204 if (-f $arg && -r $arg) {
205 push @filespec, $arg;
207 print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
208 "grog: $arg is not a readable file.";
218 ####### handle_args()
220 unless ( $arg =~ /^-/ ) { # file name, no opt, no optarg
221 unless (-f $arg && -r $arg) {
222 print 'unknown file name: ' . $arg;
224 push @filespec, $arg;
228 # now $arg starts with '-'
231 unless ($was_minus) {
232 push @filespec, $arg;
240 push(@filespec, $arg);
244 &version() if $arg =~ /^--?v/; # --version, with exit
245 &help() if $arg =~ /--?h/; # --help, with exit
247 if ( $arg =~ /^--r/ ) { # --run, no exit
252 if ( $arg =~ /^--wa/ ) { # --warnings, no exit
256 ####### handle_args()
258 if ( $arg =~ /^--(wi|l)/ ) { # --ligatures, no exit
259 # the old --with_ligatures is only kept for compatibility
260 $pdf_with_ligatures = 1;
269 if ($arg =~ /^-T$/) {
274 if ($arg =~ s/^-T(\w+)$/$1/) {
279 if ($arg =~ /^-(\w)(\w*)$/) { # maybe a groff option
281 my $opt_char_with_arg = $opt_char . ':';
283 if ( $groff_opts =~ /$opt_char_with_arg/ ) { # groff optarg
284 if ( $others ) { # optarg is here
285 push @Command, '-' . $opt_char;
286 push @Command, '-' . $others;
292 ####### handle_args()
293 } elsif ( $groff_opts =~ /$opt_char/ ) { # groff no optarg
294 push @Command, '-' . $opt_char;
295 if ( $others ) { # $others is now an opt collection
296 $arg = '-' . $others;
301 } else { # not a groff opt
302 print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
303 'unknown argument ' . $arg;
304 push(@Command, $arg);
309 @filespec = ('-') unless (@filespec);
314 ########################################################################
316 ########################################################################
318 sub handle_file_ext {
319 # get tmac from file name extension
320 # output number of found single tmac
322 # globals: @filespec, $tmac_ext;
324 foreach my $file ( @filespec ) {
325 # test for each file name in the arguments
326 unless ( open(FILE, $file eq "-" ? $file : "< $file") ) {
327 print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
328 "$Prog: can't open \'$file\': $!";
332 next unless ( $file =~ /\./ ); # file name has no dot '.'
334 ##### handle_file_ext()
343 next unless ( $ext );
345 ##### handle_file_ext()
346 # these extensions are correct, but not based on a tmac
347 next if ( $ext =~ /^(
366 ##### handle_file_ext()
367 # extensions for man tmac
374 # 'man|n' from 'groff' source
375 # '1b' from 'heirloom'
376 # '[1-9lno]' from man-pages
377 if ( $tmac_ext && $tmac_ext ne 'man' ) {
378 # found tmac is not 'man'
379 print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
380 '2 different file name extensions found ' .
381 $tmac_ext . ' and ' . $ext;
386 ##### handle_file_ext()
400 if ( $tmac_ext && $tmac_ext ne $ext ) {
401 # found tmac is not identical to former found tmac
402 ##### handle_file_ext()
403 print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
404 '2 different file name extensions found ' .
405 $tmac_ext . ' and ' . $ext;
414 print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
415 'Unknown file name extension '. $file . '.';
420 } # handle_file_ext()
423 ########################################################################
424 # handle_whole_files()
425 ########################################################################
427 sub handle_whole_files {
430 foreach my $file ( @filespec ) {
431 unless ( open(FILE, $file eq "-" ? $file : "< $file") ) {
432 print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
433 "$Prog: can't open \'$file\': $!";
436 my $line = <FILE>; # get single line
438 unless ( defined($line) ) {
439 # empty file, go to next filearg
446 unless ( &do_first_line( $line, $file ) ) {
448 &do_line( $line, $file );
450 } else { # empty line
454 while (<FILE>) { # get lines by and by
456 &do_line( $_, $file );
460 } # handle_whole_files()
463 ########################################################################
465 ########################################################################
467 # As documented for the 'man' program, the first line can be
468 # used as a groff option line. This is done by:
469 # - start the line with '\" (apostrophe, backslash, double quote)
470 # - add a space character
471 # - a word using the following characters can be appended: 'egGjJpRst'.
472 # Each of these characters means an option for the generated
473 # 'groff' command line, e.g. '-t'.
476 my ( $line, $file ) = @_;
478 # globals: %preprocs_tmacs
480 # For a leading groff options line use only [egGjJpRst]
481 if ( $line =~ /^[.']\\"[\segGjJpRst]+&/ ) {
482 # this is a groff options leading line
483 if ( $line =~ /^\./ ) {
484 # line is a groff options line with . instead of '
485 print "First line in $file must start with an apostrophe \ " .
486 "instead of a period . for groff options line!";
489 if ( $line =~ /j/ ) {
492 if ( $line =~ /e/ ) {
495 if ( $line =~ /g/ ) {
498 if ( $line =~ /G/ ) {
501 if ( $line =~ /i/ ) {
504 if ( $line =~ /p/ ) {
507 if ( $line =~ /R/ ) {
510 if ( $line =~ /s/ ) {
513 ####### do_first_line()
514 if ( $line =~ /t/ ) {
517 return 1; # a leading groff options line, 1 means yes, 0 means no
520 # not a leading short groff options line
522 return 0 if ( $line !~ /^[.']\\"\s*(.*)$/ ); # ignore non-comments
524 return 0 unless ( $1 ); # for empty comment
526 # all following array members are either preprocs or 1 tmac
527 my @words = split '\s+', $1;
531 for $word ( @words ) {
532 if ( $word eq 'ideal' ) {
534 } elsif ( $word eq 'gpic' ) {
536 } elsif ( $word =~ /^(gn|)eqn$/ ) {
539 if ( exists $preprocs_tmacs{$word} ) {
542 # not word for preproc or tmac
553 ########################################################################
555 ########################################################################
557 my $before_first_command = 1; # for check of .TH
560 my ( $line, $file ) = @_;
562 return if ( $line =~ /^[.']\s*\\"/ ); # comment
564 return unless ( $line =~ /^[.']/ ); # ignore text lines
566 $line =~ s/^['.]\s*/./; # let only a dot as leading character,
567 # remove spaces after the leading dot
568 $line =~ s/\s+$//; # remove final spaces
570 return if ( $line =~ /^\.$/ ); # ignore .
571 return if ( $line =~ /^\.\.$/ ); # ignore ..
573 if ( $before_first_command ) { # so far without 1st command
574 if ( $line =~ /^\.TH/ ) {
575 # check if .TH is 1st command for man
576 $Groff{'TH_first'} = 1 if ( $line =~ /^\.\s*TH/ );
578 if ( $line =~ /^\./ ) {
579 $before_first_command = 0;
584 $line =~ /^(\.\w+)\s*(.*)$/;
586 $command = '' unless ( defined $command );
588 $args = '' unless ( defined $args );
591 ######################################################################
593 if ( $line =~ /^\.(do)?\s*(so|mso|PS\s*<|SO_START).*$/ ) {
594 # '.so', '.mso', '.PS<...', '.SO_START'
598 if ( $line =~ /^\.(do)?\s*(so|mso|PS\s*<|SO_START).*$/ ) {
599 # '.do so', '.do mso', '.do PS<...', '.do SO_START'
605 ######################################################################
608 if ( $line =~ /^\.de1?\W?/ ) {
609 # this line is a macro definition, add it to %macros
611 $macro =~ s/^\.de1?\s+(\w+)\W*/.$1/;
612 return if ( exists $macros{$macro} );
618 # if line command is a defined macro, just ignore this line
619 return if ( exists $macros{$command} );
622 ######################################################################
625 if ( $command =~ /^(\.cstart)|(begin\s+chem)$/ ) {
626 $Groff{'chem'}++; # for chem
629 if ( $command =~ /^\.EQ$/ ) {
630 $Groff{'eqn'}++; # for eqn
633 if ( $command =~ /^\.G1$/ ) {
634 $Groff{'grap'}++; # for grap
637 if ( $command =~ /^\.Perl/ ) {
638 $Groff{'gperl'}++; # for gperl
641 if ( $command =~ /^\.pinyin/ ) {
642 $Groff{'gpinyin'}++; # for gperl
645 if ( $command =~ /^\.GS$/ ) {
646 $Groff{'grn'}++; # for grn
649 if ( $command =~ /^\.IS$/ ) {
650 $Groff{'gideal'}++; # preproc gideal for ideal
653 if ( $command =~ /^\.lilypond$/ ) {
654 $Groff{'lilypond'}++; # for glilypond
660 # pic can be opened by .PS or .PF and closed by .PE
661 if ( $command =~ /^\.PS$/ ) {
662 $Groff{'pic'}++; # normal opening for pic
665 if ( $command =~ /^\.PF$/ ) {
666 $Groff{'PF'}++; # alternate opening for pic
669 if ( $command =~ /^\.PE$/ ) {
670 $Groff{'PE'}++; # closing for pic
674 if ( $command =~ /^\.R1$/ ) {
675 $Groff{'refer'}++; # for refer
678 if ( $command =~ /^\.\[$/ ) {
679 $Groff{'refer_open'}++; # for refer open
682 if ( $command =~ /^\.\]$/ ) {
683 $Groff{'refer_close'}++; # for refer close
686 if ( $command =~ /^\.TS$/ ) {
687 $Groff{'tbl'}++; # for tbl
690 if ( $command =~ /^\.TH$/ ) {
691 unless ( $Groff{'TH_first'} ) {
692 $Groff{'TH_later'}++; # for tbl
698 ######################################################################
699 # macro package (tmac)
700 ######################################################################
705 if ( $command =~ /^\.(Dd)$/ ) {
706 $Groff{'Dd'}++; # for modern mdoc
711 # In the old version of -mdoc 'Oo' is a toggle, in the new it's
713 if ( $command =~ /^\.Oc$/ ) {
714 $Groff{'Oc'}++; # only for modern mdoc
720 # old and modern mdoc
722 if ( $command =~ /^\.Oo$/ ) {
723 $Groff{'Oo'}++; # for mdoc and mdoc-old
730 if ( $command =~ /^\.(Tp|Dp|De|Cx|Cl)$/ ) {
731 $Groff{'mdoc_old'}++; # true for old mdoc
740 if ( $command =~ /^\.AB$/ ) {
741 $Groff{'AB'}++; # for ms
744 if ( $command =~ /^\.AE$/ ) {
745 $Groff{'AE'}++; # for ms
748 if ( $command =~ /^\.AI$/ ) {
749 $Groff{'AI'}++; # for ms
752 if ( $command =~ /^\.AU$/ ) {
753 $Groff{'AU'}++; # for ms
756 if ( $command =~ /^\.NH$/ ) {
757 $Groff{'NH'}++; # for ms
760 if ( $command =~ /^\.TL$/ ) {
761 $Groff{'TL'}++; # for ms
764 if ( $command =~ /^\.XP$/ ) {
765 $Groff{'XP'}++; # for ms
773 if ( $command =~ /^\.IP$/ ) {
774 $Groff{'IP'}++; # for man and ms
777 if ( $command =~ /^\.LP$/ ) {
778 $Groff{'LP'}++; # for man and ms
782 if ( $command =~ /^\.P$/ ) {
783 $Groff{'P'}++; # for man and ms
786 if ( $command =~ /^\.PP$/ ) {
787 $Groff{'PP'}++; # for man and ms
790 if ( $command =~ /^\.SH$/ ) {
791 $Groff{'SH'}++; # for man and ms
794 if ( $command =~ /^\.UL$/ ) {
795 $Groff{'UL'}++; # for man and ms
803 if ( $command =~ /^\.OP$/ ) { # for man
807 if ( $command =~ /^\.SS$/ ) { # for man
811 if ( $command =~ /^\.SY$/ ) { # for man
815 if ( $command =~ /^\.TP$/ ) { # for man
819 if ( $command =~ /^\.UR$/ ) {
820 $Groff{'UR'}++; # for man
823 if ( $command =~ /^\.YS$/ ) { # for man
833 if ( $command =~ /^\.(
837 $Groff{'me'}++; # for me
845 if ( $command =~ /^\.(
855 $Groff{'mm'}++; # for mm and mmse
856 if ( $command =~ /^\.LO$/ ) {
857 if ( $args =~ /^(DNAMN|MDAT|BIL|KOMP|DBET|BET|SIDOR)/ ) {
858 $Groff{'mmse'}++; # for mmse
860 } elsif ( $command =~ /^\.LT$/ ) {
861 if ( $args =~ /^(SVV|SVH)/ ) {
862 $Groff{'mmse'}++; # for mmse
887 $Groff{'mom'}++; # for mom
894 ########################################################################
895 # sub make_groff_device
896 ########################################################################
899 my @preprograms = ();
900 my $correct_tmac = '';
902 sub make_groff_device {
905 # default device is 'ps' when without '-T'
907 push @devices, 'ps' unless ( @devices );
909 ###### make_groff_device()
910 for my $d ( @devices ) {
911 if ( $d =~ /^( # suitable devices
924 ###### make_groff_device()
933 push @Command, $device;
937 ###### make_groff_device()
938 if ( $device eq 'pdf' ) {
939 if ( $pdf_with_ligatures ) { # with --ligature argument
940 push( @Command, '-P-y' );
941 push( @Command, '-PU' );
942 } else { # no --ligature argument
943 if ( $with_warnings ) {
945 If you have trouble with ligatures like 'fi' in the 'groff' output, you
946 can proceed as one of
947 - add 'grog' option '--with_ligatures' or
948 - use the 'grog' option combination '-P-y -PU' or
949 - try to remove the font named similar to 'fonts-texgyre' from your system.
953 } # end of pdf device
954 } # make_groff_device()
957 ########################################################################
958 # make_groff_preproc()
959 ########################################################################
961 sub make_groff_preproc {
962 # globals: %Groff, @preprograms, @Command
964 # preprocessors without 'groff' option
965 if ( $Groff{'lilypond'} ) {
966 push @preprograms, 'glilypond';
968 if ( $Groff{'gperl'} ) {
969 push @preprograms, 'gperl';
971 if ( $Groff{'gpinyin'} ) {
972 push @preprograms, 'gpinyin';
975 # preprocessors with 'groff' option
976 if ( ( $Groff{'PS'} || $Groff{'PF'} ) && $Groff{'PE'} ) {
979 if ( $Groff{'gideal'} ) {
983 ###### make_groff_preproc()
984 $Groff{'refer'} ||= $Groff{'refer_open'} && $Groff{'refer_close'};
986 if ( $Groff{'chem'} || $Groff{'eqn'} || $Groff{'gideal'} ||
987 $Groff{'grap'} || $Groff{'grn'} || $Groff{'pic'} ||
988 $Groff{'refer'} || $Groff{'tbl'} ) {
989 push(@Command, '-s') if $Groff{'soelim'};
991 push(@Command, '-R') if $Groff{'refer'};
993 push(@Command, '-t') if $Groff{'tbl'}; # tbl before eqn
994 push(@Command, '-e') if $Groff{'eqn'};
996 push(@Command, '-j') if $Groff{'chem'}; # chem produces pic code
997 push(@Command, '-J') if $Groff{'gideal'}; # gideal produces pic
998 push(@Command, '-G') if $Groff{'grap'};
999 push(@Command, '-g') if $Groff{'grn'}; # gremlin files for -me
1000 push(@Command, '-p') if $Groff{'pic'};
1003 } # make_groff_preproc()
1006 ########################################################################
1007 # make_groff_tmac_man_ms()
1008 ########################################################################
1010 sub make_groff_tmac_man_ms {
1011 # globals: @filespec, $tmac_ext, %Groff
1013 # 'man' requests, not from 'ms'
1014 if ( $Groff{'SS'} || $Groff{'SY'} || $Groff{'OP'} ||
1015 $Groff{'TH_first'} || $Groff{'TP'} || $Groff{'UR'} ) {
1019 $tmac_ext = 'man' unless ( $tmac_ext );
1020 &err('man requests found, but file name extension ' .
1021 'was: ' . $tmac_ext) unless ( $tmac_ext eq 'man' );
1026 ###### make_groff_tmac_man_ms()
1027 # 'ms' requests, not from 'man'
1029 $Groff{'1C'} || $Groff{'2C'} ||
1030 $Groff{'AB'} || $Groff{'AE'} || $Groff{'AI'} || $Groff{'AU'} ||
1031 $Groff{'BX'} || $Groff{'CD'} || $Groff{'DA'} || $Groff{'DE'} ||
1032 $Groff{'DS'} || $Groff{'ID'} || $Groff{'LD'} || $Groff{'NH'} ||
1033 $Groff{'TH_later'} ||
1034 $Groff{'TL'} || $Groff{'UL'} || $Groff{'XP'}
1039 $tmac_ext = 'ms' unless ( $tmac_ext );
1040 &err('ms requests found, but file name extension ' .
1041 'was: ' . $tmac_ext) unless ( $tmac_ext eq 'ms' );
1046 ###### make_groff_tmac_man_ms()
1048 # both 'man' and 'ms' requests
1049 if ( $Groff{'P'} || $Groff{'IP'} ||
1050 $Groff{'LP'} || $Groff{'PP'} || $Groff{'SH'} ) {
1051 if ( $tmac_ext eq 'man' ) {
1055 } elsif ( $tmac_ext eq 'ms' ) {
1062 } # make_groff_tmac_man_ms()
1066 ########################################################################
1067 # make_groff_tmac_others()
1068 ########################################################################
1070 sub make_groff_tmac_others {
1071 # globals: @filespec, $tmac_ext, %Groff
1074 if ( ( $Groff{'Oo'} && $Groff{'Oc'} ) || $Groff{'Dd'} ) {
1080 if ( $Groff{'mdoc_old'} || $Groff{'Oo'} ) {
1081 push(@m, '-mdoc_old');
1086 if ( $Groff{'me'} ) {
1091 ##### make_groff_tmac_others()
1093 if ( $Groff{'mm'} ) {
1097 if ( $Groff{'mmse'} ) { # Swedish mm
1103 if ( $Groff{'mom'} ) {
1107 } # make_groff_tmac_others()
1110 ########################################################################
1111 # make_groff_line_rest()
1112 ########################################################################
1114 sub make_groff_line_rest {
1115 my $file_args_included; # file args now only at 1st preproc
1116 unshift @Command, 'groff';
1117 if ( @preprograms ) {
1119 $progs[0] = shift @preprograms;
1120 push(@progs, @filespec);
1121 for ( @preprograms ) {
1126 unshift @Command, @progs;
1127 $file_args_included = 1;
1129 $file_args_included = 0;
1132 ###### make_groff_line_rest()
1133 foreach (@Command) {
1135 # when one argument has several words, use accents
1136 $_ = "'" . $_ . "'";
1140 ###### make_groff_line_rest()
1143 my $nr_m_guessed = scalar @m;
1144 if ( $nr_m_guessed > 1 ) {
1145 print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
1146 'argument for -m found: ' . @m;
1150 my $nr_m_args = scalar @Mparams; # m-arguments for grog
1151 my $last_m_arg = ''; # last provided -m option
1152 if ( $nr_m_args > 1 ) {
1153 # take the last given -m argument of grog call,
1154 # ignore other -m arguments and the found ones
1155 $last_m_arg = $Mparams[-1]; # take the last -m argument
1156 print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
1157 $Prog . ": more than 1 '-m' argument: @Mparams";
1158 print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
1159 'We take the last one: ' . $last_m_arg;
1160 } elsif ( $nr_m_args == 1 ) {
1161 $last_m_arg = $Mparams[0];
1164 ###### make_groff_line_rest()
1166 if ( $last_m_arg ) {
1169 if ( $_ eq $last_m_arg ) {
1176 $final_m = $last_m_arg;
1178 print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
1179 'Provided -m argument ' . $last_m_arg .
1180 ' differs from guessed -m args: ' . @m;
1181 print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
1182 'The argument is taken.';
1183 $final_m = $last_m_arg;
1185 ###### make_groff_line_rest()
1186 } else { # no -m arg provided
1187 if ( $nr_m_guessed > 1 ) {
1188 print STDERR __FILE__ . ' ' . __LINE__ . ': ' .
1189 'More than 1 -m arguments were guessed: ' . @m;
1190 print STDERR __FILE__ . ' ' . __LINE__ . ': ' . 'Guessing stopped.';
1192 } elsif ( $nr_m_guessed == 1 ) {
1195 # no -m provided or guessed
1198 push @Command, $final_m if ( $final_m );
1200 push(@Command, @filespec) unless ( $file_args_included );
1203 # execute the 'groff' command here with option '--run'
1204 if ( $do_run ) { # with --run
1205 print STDERR __FILE__ . ' ' . __LINE__ . ': ' . "@Command";
1206 my $cmd = join ' ', @Command;
1213 } # make_groff_line_rest()
1216 ########################################################################
1218 ########################################################################
1222 usage: grog [option]... [--] [filespec]...
1224 "filespec" is either the name of an existing, readable file or "-" for
1225 standard input. If no 'filespec' is specified, standard input is
1226 assumed automatically. All arguments after a '--' are regarded as file
1227 names, even if they start with a '-' character.
1229 'option' is either a 'groff' option or one of these:
1231 -h|--help print this uasge message and exit
1232 -v|--version print version information and exit
1234 -C compatibility mode
1235 --ligatures include options '-P-y -PU' for internal font, which
1236 preserves the ligatures like 'fi'
1237 --run run the checked-out groff command
1238 --warnings display more warnings to standard error
1240 All other options should be 'groff' 1-character options. These are then
1241 appended to the generated 'groff' command line. The '-m' options will
1242 be checked by 'grog'.
1249 ########################################################################
1251 ########################################################################
1255 print "Perl version of GNU $Prog " .
1256 "in groff version " . $at_at{'GROFF_VERSION'};
1262 ########################################################################