From 162169fd97d69640ee3f2a51558624464f518c5b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 9 Oct 2023 23:07:52 +0200 Subject: [PATCH] docs/_optionsall: new page A version of optionswhen but the list is sorted on the option name Closes #306 --- docs/Makefile | 7 +++++ docs/_optionsall.html | 37 +++++++++++++++++++++++++ docs/_optionswhen.html | 2 ++ docs/alloptions.pl | 63 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+) create mode 100644 docs/_optionsall.html create mode 100755 docs/alloptions.pl diff --git a/docs/Makefile b/docs/Makefile index a5ca6ea6a1..7b9fdc0b39 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -195,6 +195,7 @@ PAGES = \ tutorial.html \ mk-ca-bundle.html \ mqtt.html \ + optionsall.html \ optionswhen.html \ projdocs.html \ protdocs.html \ @@ -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 diff --git a/docs/_optionsall.html b/docs/_optionsall.html new file mode 100644 index 0000000000..48c6c4a811 --- /dev/null +++ b/docs/_optionsall.html @@ -0,0 +1,37 @@ +#include "_doctype.html" + + curl - When command line options were introduced +#include "css.t" +#include "manpage.t" + + +#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) +
+Related: +
FAQ +
HTTP Scripting +
Man page +
+ +curl is continuously developed and new command line options are added over +time. This list shows which options that were added in which version. + +

+[ sort on version | sort on option name ] +

+ +#include "optionsall.gen" + +#include "_footer.html" + + + diff --git a/docs/_optionswhen.html b/docs/_optionswhen.html index a293e3e894..1bf0bf3360 100644 --- a/docs/_optionswhen.html +++ b/docs/_optionswhen.html @@ -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. +

+[ sort on version | sort on option name ]

#include "optionswhen.gen" diff --git a/docs/alloptions.pl b/docs/alloptions.pl new file mode 100755 index 0000000000..2955ca9a64 --- /dev/null +++ b/docs/alloptions.pl @@ -0,0 +1,63 @@ +#!/usr/bin/perl +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , 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() { + 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 "\n"; +for my $long (sort {lc($a) cmp lc($b) } keys %short) { + my $v = $added{$long}; + printf "\n", + manlink($long), + $changelog, verlink($v); +} +print "
$long$v
\n";