Loading docs/cmdline-opts/MANPAGE.md +9 −4 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ Each file has a set of meta-data and a body of text. Mutexed: (space separated list of options this overrides) Requires: (space separated list of features this option requres) See-also: (space separated list of related options) Help: (short text for the --help output for this option) --- (end of meta-data) ### Body Loading @@ -37,11 +38,15 @@ correct markup that shows both short and long version. ## Header `page-header` is the nroff formatted file that will be output before the generated options output. generated options output for the master man page. ## Generate `perl gen.pl` `./gen.pl mainpage` This command outputs an nroff file, meant to become `curl.1`. The full curl man page. This command outputs a single huge nroff file, meant to become `curl.1`. The full curl man page. `./gen.pl listhelp` Generates a full `curl --help` output for all known command line options. docs/cmdline-opts/cookie-jar.d +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ Short: c Long: cookie-jar Arg: <filename> Protocols: HTTP Help: Write cookies to <filename> after operation --- Specify to which file you want curl to write all cookies after a completed operation. Curl writes all cookies from its in-memory cookie storage to the Loading docs/cmdline-opts/cookie.d +2 −1 Original line number Diff line number Diff line Short: b Long: cookie Arg: <name=data> Arg: <data> Protocols: HTTP Help: Send cookies from string/file --- Pass the data to the HTTP server in the Cookie header. It is supposedly the data previously received from the server in a "Set-Cookie:" line. The Loading docs/cmdline-opts/gen.pl +62 −7 Original line number Diff line number Diff line Loading @@ -8,6 +8,8 @@ closedir $dh; my %optshort; my %optlong; my %helplong; my %arglong; # get the long name version, return the man page string sub manpageify { Loading Loading @@ -165,7 +167,8 @@ sub getshortlong { open(F, "<$f"); my $short; my $long; my $help; my $arg; while(<F>) { if(/^Short: (.)/i) { $short=$1; Loading @@ -173,6 +176,12 @@ sub getshortlong { elsif(/^Long: (.*)/i) { $long=$1; } elsif(/^Help: (.*)/i) { $help=$1; } elsif(/^Arg: (.*)/i) { $arg=$1; } elsif(/^---/) { last; } Loading @@ -183,6 +192,8 @@ sub getshortlong { } if($long) { $optlong{$long}=$short; $helplong{$long}=$help; $arglong{$long}=$arg; } } Loading @@ -202,11 +213,29 @@ sub header { printdesc(@d); } #------------------------------------------------------------------------ sub listhelp { foreach my $f (sort keys %helplong) { my $long = $f; my $short = $optlong{$long}; my $opt; # learn all existing options indexoptions(); if(defined($short) && $long) { $opt = "-$short, --$long"; } elsif($long && !$short) { $opt = " --$long"; } my $arg = $arglong{$long}; if($arg) { $opt .= " $arg"; } printf " %-19s %s\n", $opt, $helplong{$f}; } } sub mainpage { # show the page header header(); Loading @@ -214,3 +243,29 @@ header(); foreach my $f (sort @s) { single($f); } } sub getargs { my $f; do { $f = shift @ARGV; if($f eq "mainpage") { mainpage(); return; } elsif($f eq "listhelp") { listhelp(); return; } } while($f); print "Usage: gen.pl <mainpage/listhelp>\n"; } #------------------------------------------------------------------------ # learn all existing options indexoptions(); getargs(); docs/cmdline-opts/http1.0.d +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ Tags: Versions Protocols: HTTP Added: Mutexed: http1.1 http2 Help: Use HTTP 1.0 --- Tells curl to use HTTP version 1.0 instead of using its internally preferred HTTP version. Loading
docs/cmdline-opts/MANPAGE.md +9 −4 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ Each file has a set of meta-data and a body of text. Mutexed: (space separated list of options this overrides) Requires: (space separated list of features this option requres) See-also: (space separated list of related options) Help: (short text for the --help output for this option) --- (end of meta-data) ### Body Loading @@ -37,11 +38,15 @@ correct markup that shows both short and long version. ## Header `page-header` is the nroff formatted file that will be output before the generated options output. generated options output for the master man page. ## Generate `perl gen.pl` `./gen.pl mainpage` This command outputs an nroff file, meant to become `curl.1`. The full curl man page. This command outputs a single huge nroff file, meant to become `curl.1`. The full curl man page. `./gen.pl listhelp` Generates a full `curl --help` output for all known command line options.
docs/cmdline-opts/cookie-jar.d +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ Short: c Long: cookie-jar Arg: <filename> Protocols: HTTP Help: Write cookies to <filename> after operation --- Specify to which file you want curl to write all cookies after a completed operation. Curl writes all cookies from its in-memory cookie storage to the Loading
docs/cmdline-opts/cookie.d +2 −1 Original line number Diff line number Diff line Short: b Long: cookie Arg: <name=data> Arg: <data> Protocols: HTTP Help: Send cookies from string/file --- Pass the data to the HTTP server in the Cookie header. It is supposedly the data previously received from the server in a "Set-Cookie:" line. The Loading
docs/cmdline-opts/gen.pl +62 −7 Original line number Diff line number Diff line Loading @@ -8,6 +8,8 @@ closedir $dh; my %optshort; my %optlong; my %helplong; my %arglong; # get the long name version, return the man page string sub manpageify { Loading Loading @@ -165,7 +167,8 @@ sub getshortlong { open(F, "<$f"); my $short; my $long; my $help; my $arg; while(<F>) { if(/^Short: (.)/i) { $short=$1; Loading @@ -173,6 +176,12 @@ sub getshortlong { elsif(/^Long: (.*)/i) { $long=$1; } elsif(/^Help: (.*)/i) { $help=$1; } elsif(/^Arg: (.*)/i) { $arg=$1; } elsif(/^---/) { last; } Loading @@ -183,6 +192,8 @@ sub getshortlong { } if($long) { $optlong{$long}=$short; $helplong{$long}=$help; $arglong{$long}=$arg; } } Loading @@ -202,11 +213,29 @@ sub header { printdesc(@d); } #------------------------------------------------------------------------ sub listhelp { foreach my $f (sort keys %helplong) { my $long = $f; my $short = $optlong{$long}; my $opt; # learn all existing options indexoptions(); if(defined($short) && $long) { $opt = "-$short, --$long"; } elsif($long && !$short) { $opt = " --$long"; } my $arg = $arglong{$long}; if($arg) { $opt .= " $arg"; } printf " %-19s %s\n", $opt, $helplong{$f}; } } sub mainpage { # show the page header header(); Loading @@ -214,3 +243,29 @@ header(); foreach my $f (sort @s) { single($f); } } sub getargs { my $f; do { $f = shift @ARGV; if($f eq "mainpage") { mainpage(); return; } elsif($f eq "listhelp") { listhelp(); return; } } while($f); print "Usage: gen.pl <mainpage/listhelp>\n"; } #------------------------------------------------------------------------ # learn all existing options indexoptions(); getargs();
docs/cmdline-opts/http1.0.d +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ Tags: Versions Protocols: HTTP Added: Mutexed: http1.1 http2 Help: Use HTTP 1.0 --- Tells curl to use HTTP version 1.0 instead of using its internally preferred HTTP version.