Skip to content

Commit

Permalink
docs/_optionsall: new page
Browse files Browse the repository at this point in the history
A version of optionswhen but the list is sorted on the option name

Closes #306
  • Loading branch information
bagder committed Oct 9, 2023
1 parent a8de89b commit 162169f
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ PAGES = \
tutorial.html \
mk-ca-bundle.html \
mqtt.html \
optionsall.html \
optionswhen.html \
projdocs.html \
protdocs.html \
Expand Down Expand Up @@ -265,6 +266,12 @@ optionswhen.html: _optionswhen.html optionswhen.gen
optionswhen.gen: $(DOCROOT)/options-in-versions optionswhen.pl
./optionswhen.pl $< > $@

optionsall.html: _optionsall.html optionsall.gen
$(ACTION)

optionsall.gen: $(DOCROOT)/options-in-versions alloptions.pl
./alloptions.pl $< > $@

curl.1: ../cvssource/docs/cmdline-opts/*.d
(cd ../cvssource/docs/cmdline-opts && perl gen.pl mainpage *.d) > curl.1

Expand Down
37 changes: 37 additions & 0 deletions docs/_optionsall.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include "_doctype.html"
<html>
<head> <title>curl - When command line options were introduced</title>
#include "css.t"
#include "manpage.t"
</head>

#define CURL_DOCS
#define DOCS_MANPAGE
#define TOOL_DOCS
#define CURL_URL docs/optionswhen.html

#include "_menu.html"
#include "setup.t"

WHERE3(Docs, "/docs/", Tool, "/docs/tooldocs.html", Options when)
TITLE(When command line options were introduced)
<div class="relatedbox">
<b>Related:</b>
<br><a href="faq.html">FAQ</a>
<br><a href="httpscripting.html">HTTP Scripting</a>
<br><a href="manpage.html">Man page</a>
</div>

curl is continuously developed and new command line options are added over
time. This list shows which options that were added in which version.

<p>
[<b> <a href="optionswhen.html">sort on version</a> | <b>sort on option name</b> ]
<p>

#include "optionsall.gen"

#include "_footer.html"

</body>
</html>
2 changes: 2 additions & 0 deletions docs/_optionswhen.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
curl is continuously developed and new command line options are added over
time. This list shows which options that were added in which version.

<p>
[<b> sort on version</b> | <a href="optionsall.html">sort on option name</a> ]
<p>

#include "optionswhen.gen"
Expand Down
63 changes: 63 additions & 0 deletions docs/alloptions.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/perl
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) Daniel Stenberg, <[email protected]>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
# SPDX-License-Identifier: curl
#
###########################################################################

# options-in-versions
my $oinv = $ARGV[0];

my $html = "manpage.html";
my $changelog = "/changes.html";

my %vers;
open(O, "<$oinv");
while(<O>) {
if($_ =~ /^(\S+) (\((.*)\)|) +([0-9.]+)/) {
my ($long, $sh, $version) = ($1, $3, $4);
$added{$long} = $version;
$short{$long} = $sh;
}
}

sub verlink {
my ($ver)= @_;
$ver =~ s/\./_/g;
return $ver;
}

sub manlink {
my ($long)= @_;
if($short{$long}) {
return $short{$long};
}
return $long;
}

print "<table>\n";
for my $long (sort {lc($a) cmp lc($b) } keys %short) {
my $v = $added{$long};
printf "<tr><td><a href=\"manpage.html#%s\">$long</a></td><td><a href=\"%s#%s\">$v</a></td></tr>\n",
manlink($long),
$changelog, verlink($v);
}
print "</table>\n";

0 comments on commit 162169f

Please sign in to comment.