1010# Author: Daniel Stenberg <daniel@haxx.se>
1111# Web: https://daniel.haxx.se/projects/roffit
1212
13- my $version = " 0.12 " ;
13+ my $version = " 0.13 " ;
1414
1515use strict;
1616# use warnings;
@@ -37,6 +37,7 @@ my @mandirs;
3737my $mandir ;
3838my $hrefdir =" ." ;
3939my $filename ;
40+ my $leavecase ;
4041
4142while ($ARGV [0]) {
4243 if ($ARGV [0] eq " --bare" ) {
@@ -48,6 +49,10 @@ while($ARGV[0]) {
4849 print " roffit $version (https://daniel.haxx.se/projects/roffit/)\n " ;
4950 exit ;
5051 }
52+ elsif ($ARGV [0] eq " --preserve-case" ) {
53+ $leavecase = 1;
54+ exit ;
55+ }
5156 elsif ($ARGV [0] =~ / ^--mandir=(.*)/ ) {
5257 # check for other HTMLized man pages in these given dirs
5358 # can be specified multiple times
@@ -63,12 +68,14 @@ while($ARGV[0]) {
6368 }
6469 elsif ($ARGV [0] =~ / ^(--help|-h)/ ) {
6570 print $debugFH " Usage: roffit [options] [infile] < infile > outfile\n " ,
66- " Options:\n " ,
67- " --version display roffit version and exit\n " ,
68- " --bare do not put in HTML, HEAD, BODY tags\n " ,
69- " --mandir=<dir> check for other HTMLized man pages in these dirs\n " ,
70- " --hrefdir=<dir> if a manpage is found in the --mandir, this is the\n " ,
71- " dir we prefix the HTML file name with in the output\n " ;
71+ " Options:\n " ,
72+ " --bare do not put in HTML, HEAD, BODY tags\n " ,
73+ " --hrefdir=<dir> if a manpage is found in the --mandir, this is the\n " ,
74+ " dir we prefix the HTML file name with in the output\n " ,
75+ " --mandir=<dir> check for other HTMLized man pages in these dirs\n " ,
76+ " --preserve-case leave case of section headers untouched\n " ,
77+ " --version display roffit version and exit\n " ;
78+
7279 exit ;
7380 }
7481 else {
@@ -384,6 +391,7 @@ sub parsefile {
384391
385392 $rest =~ s /\" // g ; # cut off quotes
386393 $rest = do_encode($rest );
394+ $rest = ucfirst (lc ($rest )) if (!$leavecase );
387395 $out = " <a name=\" $name \" ></a><h2 class=\" nroffsh\" >$rest </h2>" ;
388396 $indentlevel =0;
389397 $within_tp =0;
0 commit comments