8000 wcurl: import v2025.04.20 script + docs · curl/curl@23bed34 · GitHub
[go: up one dir, main page]

Skip to content
/ curl Public

Commit 23bed34

Browse files
committed
wcurl: import v2025.04.20 script + docs
Build/install the man page. Install the script. This an "import" rather than just adding the script into the release tarball with maketgz to make sure the tarball build is completely reproducible. wcurl development, issues etc is still to be done at https://github.com/curl/wcurl Assisted-by: Viktor Szakats Assisted-by: Samuel Henrique Closes #17035
1 parent da9494e commit 23bed34

File tree

8 files changed

+487
-6
lines changed

8 files changed

+487
-6
lines changed

.github/scripts/spellcheck.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ matrix:
2929
- 'strong'
3030
- 'em'
3131
sources:
32-
- '**/*.md|!docs/BINDINGS.md|!docs/DISTROS.md|!docs/CIPHERS-TLS12.md'
32+
- '**/*.md|!docs/BINDINGS.md|!docs/DISTROS.md|!docs/CIPHERS-TLS12.md|!docs/wcurl.md'

.github/workflows/checksrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
codespell \
7070
--skip scripts/mk-ca-bundle.pl \
7171
--skip src/tool_hugehelp.c \
72+
--skip scripts/wcurl \
7273
-I .github/scripts/codespell-ignore.txt \
7374
CMake include m4 scripts src lib
7475

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,6 +2503,13 @@ if(NOT CURL_DISABLE_INSTALL)
25032503
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/CMake/cmake_uninstall.cmake")
25042504
endif()
25052505

2506+
install(FILES "${PROJECT_SOURCE_DIR}/scripts/wcurl"
2507+
DESTINATION ${CMAKE_INSTALL_BINDIR}
2508+
PERMISSIONS
2509+
OWNER_READ OWNER_WRITE OWNER_EXECUTE
2510+
GROUP_READ GROUP_EXECUTE
2511+
WORLD_READ WORLD_EXECUTE)
2512+
25062513
# The `-DEV` part is important
25072514
string(REGEX REPLACE "([0-9]+\.[0-9]+)\.([0-9]+.*)" "\\2" CPACK_PACKAGE_VERSION_PATCH "${_curl_version}")
25082515
set(CPACK_GENERATOR "TGZ")

docs/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if(ENABLE_CURL_MANUAL AND BUILD_CURL_EXE)
3030
endif()
3131

3232
if(BUILD_MISC_DOCS)
33-
foreach(_man_misc IN ITEMS "curl-config" "mk-ca-bundle")
33+
foreach(_man_misc IN ITEMS "curl-config" "mk-ca-bundle" "wcurl")
3434
set(_man_target "${CMAKE_CURRENT_BINARY_DIR}/${_man_misc}.1")
3535
add_custom_command(OUTPUT "${_man_target}"
3636
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}

docs/Makefile.am

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ if BUILD_DOCS
2828
# if we disable man page building, ignore these
2929
MK_CA_DOCS = mk-ca-bundle.1
3030
CURLCONF_DOCS = curl-config.1
31-
man_MANS = curl-config.1
31+
man_MANS = curl-config.1 wcurl.1
3232
endif
3333

34-
CURLPAGES = curl-config.md mk-ca-bundle.md
34+
CURLPAGES = curl-config.md mk-ca-bundle.md wcurl.md
3535

3636
SUBDIRS = . cmdline-opts libcurl
3737
DIST_SUBDIRS = $(SUBDIRS) examples
3838

3939
if BUILD_DOCS
40-
CLEANFILES = mk-ca-bundle.1 curl-config.1
40+
CLEANFILES = mk-ca-bundle.1 curl-config.1 wcurl.1
4141
endif
4242

4343
INTERNALDOCS = \
@@ -134,5 +134,7 @@ curl-config.1: curl-config.md
134134

135135
mk-ca-bundle.1: mk-ca-bundle.md
136136

137+
wcurl.1: wcurl.md
138+
137139
distclean:
138140
rm -f $(CLEANFILES)

docs/wcurl.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
---
2+
c: Copyright (C) Samuel Henrique <samueloph@debian.org>, Sergio Durigan Junior <sergiodj@debian.org> and many contributors, see the AUTHORS file.
3+
SPDX-License-Identifier: curl
4+
Title: wcurl
5+
Section: 1
6+
Source: wcurl
7+
See-also:
8+
- curl (1)
9+
- trurl (1)
10+
Added-in: n/a
11+
---
12+
13+
# NAME
14+
15+
**wcurl** - a simple wrapper around curl to easily download files.
16+
17+
# SYNOPSIS
18+
19+
**wcurl \<URL\>...**
20+
21+
**wcurl [--curl-options \<CURL_OPTIONS\>]... [--dry-run] [--no-decode-filename] [-o|-O|--output \<PATH\>] [--] \<URL\>...**
22+
23+
**wcurl [--curl-options=\<CURL_OPTIONS\>]... [--dry-run] [--no-decode-filename] [--output=\<PATH\>] [--] \<URL\>...**
24+
25+
**wcurl -V|--version**
26+
27+
**wcurl -h|--help**
28+
29+
# DESCRIPTION
30+
31+
**wcurl** is a simple curl wrapper which lets you use curl to download files
32+
without having to remember any parameters.
33+
34+
Simply call **wcurl** with a list of URLs you want to download and **wcurl**
35+
picks sane defaults.
36+
37+
If you need anything more complex, you can provide any of curl's supported
38+
parameters via the **--curl-options** option. Just beware that you likely
39+
should be using curl directly if your use case is not covered.
40+
41+
By default, **wcurl** does:
42+
43+
## * Percent-encode whitespaces in URLs;
44+
45+
## * Download multiple URLs in parallel
46+
if the installed curl's version is \>= 7.66.0 (--parallel);
47+
48+
## * Follow redirects;
49+
50+
## * Automatically choose a filename as output;
51+
52+
## * Avoid overwriting files
53+
if the installed curl's version is \>= 7.83.0 (--no-clobber);
54+
55+
## * Perform retries;
56+
57+
## * Set the downloaded file timestamp
58+
to the value provided by the server, if available;
59+
60+
## * Default to https
61+
if the URL does not contain any scheme;
62+
63+
## * Disable curl's URL globbing parser
64+
so {} and [] characters in URLs are not treated specially;
65+
66+
## * Percent-decode the resulting filename;
67+
68+
## * Use 'index.html' as the default filename
69+
if there is none in the URL.
70+
71+
# OPTIONS
72+
73+
## --curl-options, --curl-options=\<CURL_OPTIONS\>...
74+
75+
Specify extra options to be passed when invoking curl. May be specified more
76+
than once.
77+
78+
## -o, -O, --output, --output=\<PATH\>
79+
80+
Use the provided output path instead of getting it from the URL. If multiple
81+
URLs are provided, resulting files share the same name with a number appended to
82+
the end (curl \>= 7.83.0). If this option is provided multiple times, only the
83+
last value is considered.
84+
85+
## --no-decode-filename
86+
87+
Don't percent-decode the output filename, even if the percent-encoding in the
88+
URL was done by **wcurl**, e.g.: The URL contained whitespaces.
89+
90+
## --dry-run
91+
92+
Do not actually execute curl, just print what would be invoked.
93+
94+
## -V, \--version
95+
96+
Print version information.
97+
98+
## -h, \--help
99+
100+
Print help message.
101+
102+
# CURL_OPTIONS
103+
104+
Any option supported by curl can be set here. This is not used by **wcurl**; it
105+
is instead forwarded to the curl invocation.
106+
107+
# URL
108+
109+
URL to be downloaded. Anything that is not a parameter is considered
110+
an URL. Whitespaces are percent-encoded and the URL is passed to curl, which
111+
then performs the parsing. May be specified more than once.
112+
113+
# EXAMPLES
114+
115+
Download a single file:
116+
117+
**wcurl example.com/filename.txt**
118+
119+
Download two files in parallel:
120+
121+
**wcurl example.com/filename1.txt example.com/filename2.txt**
122+
123+
Download a file passing the **--progress-bar** and **--http2** flags to curl:
124+
125+
**wcurl --curl-options="--progress-bar --http2" example.com/filename.txt**
126+
127+
Resume from an interrupted download (if more options are used, this needs to
128+
be E975 the last one in the list):
129+
130+
**wcurl --curl-options="--continue-at -" example.com/filename.txt**
131+
132+
# AUTHORS
133+
134+
Samuel Henrique \<samueloph@debian.org\>
135+
Sergio Durigan Junior \<sergiodj@debian.org\>
136+
and many contributors, see the AUTHORS file.
137+
138+
# REPORTING BUGS
139+
140+
If you experience any problems with **wcurl** that you do not experience with
141+
curl, submit an issue on Github: https://github.com/curl/wcurl
142+
143+
# COPYRIGHT
144+
145+
**wcurl** is licensed under the curl license

scripts/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
EXTRA_DIST = coverage.sh completion.pl firefox-db2pem.sh checksrc.pl \
2626
mk-ca-bundle.pl mk-unity.pl schemetable.c cd2nroff nroff2cd cdall cd2cd managen \
2727
dmaketgz maketgz release-tools.sh verify-release cmakelint.sh mdlinkcheck \
28-
CMakeLists.txt randdisable
28+
CMakeLists.txt randdisable wcurl
29+
30+
dist_bin_SCRIPTS = wcurl
2931

3032
ZSH_FUNCTIONS_DIR = @ZSH_FUNCTIONS_DIR@
3133
FISH_FUNCTIONS_DIR = @FISH_FUNCTIONS_DIR@

0 commit comments

Comments
 (0)
0