Commit 8b2f22ed authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

curl: generate the --help output

... using the docs/cmdline-opts/gen.pl script, so that we get all the
command line option documentation from the same source.

The generation of the list has to be done manually and pasted into the
source code.

Closes #1465
parent 73afcfc0
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -307,10 +307,12 @@ sub listhelp {
        if($arg) {
            $opt .= " $arg";
        }
        my $desc = $helplong{$f};
        $desc =~ s/\"/\\\"/g; # escape double quotes

        my $line = sprintf " %-19s %s\n", $opt, $helplong{$f};
        my $line = sprintf "  {\"%s\",\n   \"%s\"},\n", $opt, $desc;

        if(length($line) > 79) {
        if(length($opt) + length($desc) > 78) {
            print STDERR "WARN: the --$long line is too long\n";
        }
        print $line;
+429 −249

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 2016, 2017, 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
@@ -232,7 +232,7 @@ my @toolhelp; # store all parsed parameters
while(<R>) {
    chomp;
    my $l= $_;
    if(/^  \" *(.*)/) {
    if(/^  \{\" *(.*)/) {
        my $str=$1;
        my $combo;
        if($str =~ /^-(.), --([a-z0-9.-]*)/) {