From ffb634d4ef5378c5f8255577fb65df3de82c0396 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 28 Sep 2021 17:36:09 +0200 Subject: tool_listhelp: easier to generate with gen.pl tool_listhelp.c is now a separate file with only the command line --help output, exactly as generated by gen.pl. This makes it easier to generate updates according to what's in the docs/cmdline-opts docs. cd $srcroot/docs/cmdline-opts ./gen.pl listhelp *.d > $srcroot/src/tool_listhelp.c With a configure build, this also works: make -C src listhelp Closes #7787 --- docs/cmdline-opts/gen.pl | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'docs/cmdline-opts') diff --git a/docs/cmdline-opts/gen.pl b/docs/cmdline-opts/gen.pl index 405099b71..2a89d5e76 100755 --- a/docs/cmdline-opts/gen.pl +++ b/docs/cmdline-opts/gen.pl @@ -47,6 +47,7 @@ my %catlong; use POSIX qw(strftime); my $date = strftime "%B %d %Y", localtime; +my $year = strftime "%Y", localtime; my $version = "unknown"; open(INC, "<../../include/curl/curlver.h"); @@ -418,6 +419,42 @@ sub header { } sub listhelp { + print <, 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. + * + ***************************************************************************/ +#include "tool_setup.h" +#include "tool_help.h" + +/* + * DO NOT edit tool_listhelp.c manually. + * This source file is generated with the following command: + + cd \$srcroot/docs/cmdline-opts + ./gen.pl listhelp *.d > \$srcroot/src/tool_listhelp.c + */ + +const struct helptxt helptext[] = { +HEAD + ; foreach my $f (sort keys %helplong) { my $long = $f; my $short = $optlong{$long}; @@ -455,6 +492,11 @@ sub listhelp { } print $line; } + print <