diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-09-28 17:36:09 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-09-30 17:50:48 +0200 |
commit | ffb634d4ef5378c5f8255577fb65df3de82c0396 (patch) | |
tree | f82d8cdb5888dc01743bcc0a98871c5e4b01f931 /docs | |
parent | d10a0af2f3ba4ad7a3b9636b77cc81e1a9c667d8 (diff) | |
download | curl-ffb634d4ef5378c5f8255577fb65df3de82c0396.tar.gz |
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
Diffstat (limited to 'docs')
-rwxr-xr-x | docs/cmdline-opts/gen.pl | 42 |
1 files changed, 42 insertions, 0 deletions
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 <<HEAD +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \\| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \\___|\\___/|_| \\_\\_____| + * + * Copyright (C) 1998 - $year, 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 + * 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 <<FOOT + { NULL, NULL, CURLHELP_HIDDEN } +}; +FOOT + ; } sub listcats { |