all: $(MANPAGE)
-$(MANPAGE): $(DPAGES) $(OTHERPAGES) Makefile.inc
+$(MANPAGE): $(DPAGES) $(OTHERPAGES) Makefile.inc gen.pl
$(GEN)(rm -f $(MANPAGE) && cd $(srcdir) && @PERL@ ./gen.pl mainpage $(DPAGES) > $(builddir)/manpage.tmp && mv $(builddir)/manpage.tmp $(MANPAGE))
my $date = strftime "%B %d %Y", localtime;
my $year = strftime "%Y", localtime;
my $version = "unknown";
+my $globals;
open(INC, "<../../include/curl/curlver.h");
while(<INC>) {
while(<F>) {
s/%DATE/$date/g;
s/%VERSION/$version/g;
+ s/%GLOBALS/$globals/g;
push @d, $_;
}
close(F);
* | (__| |_| | _ <| |___
* \\___|\\___/|_| \\_\\_____|
*
- * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) Daniel Stenberg, <daniel\@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
}
}
+sub listglobals {
+ my (@files) = @_;
+ my @globalopts;
+
+ # Find all global options and output them
+ foreach my $f (sort @files) {
+ open(F, "<:crlf", "$f") ||
+ next;
+ my $long;
+ while(<F>) {
+ if(/^Long: *(.*)/i) {
+ $long=$1;
+ }
+ elsif(/^Scope: global/i) {
+ push @globalopts, $long;
+ last;
+ }
+ elsif(/^---/) {
+ last;
+ }
+ }
+ close(F);
+ }
+ return $ret if($ret);
+ for my $e (0 .. $#globalopts) {
+ $globals .= sprintf "%s--%s", $e?($globalopts[$e+1] ? ", " : " and "):"",
+ $globalopts[$e],;
+ }
+}
+
sub mainpage {
my (@files) = @_;
my $ret;
sub getargs {
my ($f, @s) = @_;
if($f eq "mainpage") {
+ listglobals(@s);
mainpage(@s);
return;
}
When --next is used, it resets the parser state and you start again with a
clean option state, except for the options that are "global". Global options
will retain their values and meaning even after --next.
+
+The following options are global:
+%GLOBALS.
+