Skip to content

Commit

Permalink
Fix help with last version of curl
Browse files Browse the repository at this point in the history
Fixes #33
  • Loading branch information
rs committed Nov 3, 2020
1 parent 78f7af5 commit 3e0d2c5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion args/curlopts.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package args

var (
curlShortValues = "EKCbcdDFPHmoUreXYytzTuAw"
curlShortValues = "EKCbcdDFPHhmoUreXYytzTuAw"
curlLongValues = []string{
"abstract-unix-socket",
"alt-svc",
"cacert",
"capath",
"cert",
Expand All @@ -16,6 +17,7 @@ var (
"cookie",
"cookie-jar",
"crlfile",
"curves",
"data",
"data-ascii",
"data-binary",
Expand All @@ -26,9 +28,12 @@ var (
"dns-ipv4-addr",
"dns-ipv6-addr",
"dns-servers",
"doh-url",
"dump-header",
"egd-file",
"engine",
"etag-compare",
"etag-save",
"expect100-timeout",
"form",
"form-string",
Expand All @@ -39,6 +44,7 @@ var (
"ftp-ssl-ccc-mode",
"happy-eyeballs-timeout-ms",
"header",
"help",
"hostpubmd5",
"interface",
"keepalive-time",
Expand All @@ -59,6 +65,7 @@ var (
"noproxy",
"oauth2-bearer",
"output",
"output-dir",
"pass",
"pinnedpubkey",
"proto",
Expand Down Expand Up @@ -91,6 +98,7 @@ var (
"retry",
"retry-delay",
"retry-max-time",
"sasl-authzid",
"service-name",
"socks4",
"socks4a",
Expand Down
2 changes: 1 addition & 1 deletion args/gen.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

curl -h|perl -pe 's/^\s*(?:-([^-]),\s+)?--(.*?)\s+<.*?>.*/push @a, $1; push @b, $2/e; undef $_; END {print "package args\n\nvar (\n\tcurlShortValues = \"", @a, "\"\n\tcurlLongValues = []string{\n", join(",\n", map {"\t\t\"$_\""} @b), "}\n)\n"}' > curlopts.go
curl -h all|perl -pe 's/^\s*(?:-([^-]),\s+)?--(.*?)\s+<.*?>.*/push @a, $1; push @b, $2/e; undef $_; END {print "package args\n\nvar (\n\tcurlShortValues = \"", @a, "\"\n\tcurlLongValues = []string{\n", join(",\n", map {"\t\t\"$_\""} @b), "}\n)\n"}' > curlopts.go
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func main() {

if len(opts) == 0 {
// Show help if no args
opts = append(opts, "-h")
opts = append(opts, "-h", "all")
} else {
// Remove progress bar.
opts = append(opts, "-s", "-S")
Expand Down

0 comments on commit 3e0d2c5

Please sign in to comment.