'get|G!' => undef, # Send the -d data with a HTTP GET (H)
'silent|s!' => 1, # Silent mode (don't output anything)
'header|H=s' => \@H, # LINE Pass custom header LINE to server (H)
- #'header|H=s' => 1, #\@H, # LINE Pass custom header LINE to server (H)
+ 'netrc|n!', # Must read .netrc for user name and password
);
my @CURL_OPT = keys %CURL_OPT;
my $CURL_OPT_EXP = join('|',map{ /^(.*?)\|/ ? $1 : $_ } @CURL_OPT);
csv2txt("\t",shift @ARGV) if @ARGV and $ARGV[0] eq '--csv2txt' and shift @ARGV;
curl_help() if @ARGV and $ARGV[0] eq '--curl_help' and shift @ARGV;
parse_debug() if @ARGV and $ARGV[0] eq '--parse_debug' and shift @ARGV;
-curl_help_hash() if @ARGV and $ARGV[0] eq '--curl_help_hash' and shift @ARGV;
my @EXEC = @ARGV;
my %Opt = map{ (/^(.*?)\|/ ? $1 : $_) => $CURL_OPT{$_} } keys %CURL_OPT;
}
-sub curl_help_hash {
+sub curl_help {
open(CURL,'curl --help |') or die "Can't run curl";
my $o = $CURL_OPT_EXP;
while (<CURL>) {
close CURL;
exit;
}
-sub curl_help {
- open(CURL,'curl --help |') or die "Can't run curl";
- my $o = $CURL_OPT_EXP;
- while (<CURL>) {
- #print $_;
- #/^\s*(?:-(\w+),\s*)?--([\w-]+)(.*?)\$/ or next;
- @_ = /(?:-(\w+).*?)?--($o)\s+(.*?)$/ or next;
- #warn $_;
- push(@_,'') if @_<3; $_[0] = '' unless $_[0];
- $_[1] .= '|' if $_[0];
- my $type = '!';
- $type = '=s' if $_[2] =~ /^[A-Z]{2,}/;
- #print "=item B<option[$_[1]$_[0]$type]> $_[2]\n\n";
- print " option[$_[1]$_[0]$type] $_[2]\n";
- }
- close CURL;
- exit;
-}
__DATA__
=head1 NAME