aboutsummaryrefslogtreecommitdiff
path: root/docs/cmdline-opts/gen.pl
diff options
context:
space:
mode:
Diffstat (limited to 'docs/cmdline-opts/gen.pl')
-rwxr-xr-xdocs/cmdline-opts/gen.pl22
1 files changed, 19 insertions, 3 deletions
diff --git a/docs/cmdline-opts/gen.pl b/docs/cmdline-opts/gen.pl
index c8b129360..89a5df845 100755
--- a/docs/cmdline-opts/gen.pl
+++ b/docs/cmdline-opts/gen.pl
@@ -1,5 +1,21 @@
#!/usr/bin/perl
+=begin comment
+
+This script generates the manpage.
+
+Example: gen.pl mainpage > curl.1
+
+Dev notes:
+
+We open *input* files in :crlf translation (a no-op on many platforms) in
+case we have CRLF line endings in Windows but a perl that defaults to LF.
+Unfortunately it seems some perls like msysgit can't handle a global input-only
+:crlf so it has to be specified on each file open for text input.
+
+=end comment
+=cut
+
my $some_dir=".";
opendir(my $dh, $some_dir) || die "Can't opendir $some_dir: $!";
@@ -85,7 +101,7 @@ sub added {
sub single {
my ($f, $standalone)=@_;
- open(F, "<$f") ||
+ open(F, "<:crlf", "$f") ||
return 1;
my $short;
my $long;
@@ -219,7 +235,7 @@ sub single {
sub getshortlong {
my ($f)=@_;
- open(F, "<$f");
+ open(F, "<:crlf", "$f");
my $short;
my $long;
my $help;
@@ -265,7 +281,7 @@ sub indexoptions {
sub header {
my ($f)=@_;
- open(F, "<$f");
+ open(F, "<:crlf", "$f");
my @d;
while(<F>) {
push @d, $_;