managen: wordwrap long example lines in ASCII output

The entire ASCII version of the manpage word wraps at a fixed column,
while example command lines can easily go wider than so.

This change now makes manage work on wrapping long example command lines
to make them look nicer. And also to avoid triggering the build error
caused by too long lines in the output.

Quoted lines cannot be wrapped, so managen now errors out if they are
"too long". With this addition, the 'maxline' script is removed as it is
no longer needed.

Closes #14543
This commit is contained in:
Daniel Stenberg 2024-08-14 13:36:20 +02:00
parent 178e8ba2d1
commit 0066d169e8
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 64 additions and 50 deletions

View file

@ -40,7 +40,6 @@ MANAGEN=$(top_srcdir)/scripts/managen
MAXLINE=$(top_srcdir)/scripts/maxline
# Maximum number of columns accepted in the ASCII version of the manpage
MAXCOLS=100
INCDIR=$(top_srcdir)/include
if BUILD_DOCS
@ -55,7 +54,7 @@ $(MANPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN)
$(GEN)(rm -f $(MANPAGE) && @PERL@ $(MANAGEN) -d $(srcdir) -I $(INCDIR) mainpage $(DPAGES) > manpage.tmp.$$$$ && mv manpage.tmp.$$$$ $(MANPAGE))
$(ASCIIPAGE): $(DPAGES) $(SUPPORT) mainpage.idx Makefile.inc $(MANAGEN)
$(GEN)(rm -f $(ASCIIPAGE) && @PERL@ $(MANAGEN) -d $(srcdir) -I $(INCDIR) ascii $(DPAGES) | @PERL@ $(MAXLINE) $(MAXCOLS) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE))
$(GEN)(rm -f $(ASCIIPAGE) && @PERL@ $(MANAGEN) -d $(srcdir) -I $(INCDIR) ascii $(DPAGES) > asciipage.tmp.$$$$ && mv asciipage.tmp.$$$$ $(ASCIIPAGE))
listhelp:
$(MANAGEN) -d $(srcdir) listhelp $(DPAGES) > $(top_builddir)/src/tool_listhelp.c

View file

@ -72,11 +72,13 @@ filename=, like this:
If filename/path contains ',' or ';', it must be quoted by double-quotes like:
curl -F "file=@\"local,file\";filename=\"name;in;post\"" example.com
curl -F "file=@\"local,file\";filename=\"name;in;post\"" \
https://example.com
or
curl -F 'file=@"local,file";filename="name;in;post"' example.com
curl -F 'file=@"local,file";filename="name;in;post"' \
https://example.com
Note that if a filename/path is quoted by double-quotes, any double-quote
or backslash within the filename must be escaped by backslash.
@ -84,7 +86,8 @@ or backslash within the filename must be escaped by backslash.
Quoting must also be applied to non-file data if it contains semicolons,
leading/trailing spaces or leading double quotes:
curl -F 'colors="red; green; blue";type=text/x-myapp' example.com
curl -F 'colors="red; green; blue";type=text/x-myapp' \
https://example.com
You can add custom headers to the field by setting headers=, like

View file

@ -24,7 +24,8 @@ if a `~/.ipfs/gateway` file holding the gateway URL exists.
If you run a local IPFS node, this gateway is by default available under
`http://localhost:8080`. A full example URL would look like:
curl --ipfs-gateway http://localhost:8080 ipfs://bafybeigagd5nmnn2iys2f3
curl --ipfs-gateway http://localhost:8080 \
ipfs://bafybeigagd5nmnn2iys2f3
There are many public IPFS gateways. See for example:
https://ipfs.github.io/public-gateway-checker/