-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
curl: --help [option] displays documentation for given cmdline option #13997
Conversation
0a5b95e
to
3d632aa
Compare
I did a quick comparison with brotli and zstd to see how big the gains would be if we would compress the data differently - since most/many builds already use those compression libs. It turns out the differences are not revolutionary. When using
|
0ea2d5c
to
42acd1a
Compare
a7e367f
to
11fdd2a
Compare
11fdd2a
to
ccab133
Compare
Left for future improvement: the displayed manpage section ends with a newline too many. |
It seems it's impossible to show the help for options that are negated in the documentation, since they aren't kept that way in the Another side affect of this is that when you look for
|
Oh, so it needs some extra magic. I'll add this as a TODO to fix.
Actually, that trick only works if there actually is a space afterwards in the manpage, which for example |
Test 1707 to 1710 verify Closes #13997
6eb7cdc
to
70f58b5
Compare
Test 1707 to 1710 verify Closes #13997
42e453e
to
4fd7e15
Compare
Since the documentation text blob might be gzipped, it needs to search for what to output in a streaming manner. It then first searches for "\nALL OPTIONS". Then, it looks for the start to display at "\n -[option]" and stops again at "\n -". Except for the last option in the man page, which ends at "\nFILES" - the subtitle for the section following all options in the manpage. Test 1707 to 1710 verify Closes #13997
1e93e1a
to
1e3f2e4
Compare
Since the documentation text blob might be gzipped, it needs to search for what to output in a streaming manner. It then first searches for "\nALL OPTIONS". Then, it looks for the start to display at "\n -[option]" and stops again at "\n -". Except for the last option in the man page, which ends at "\nFILES" - the subtitle for the section following all options in the manpage. Test 1707 to 1710 verify Closes #13997
1e3f2e4
to
c02992d
Compare
Analysis of PR #13997: Generated by Testclutch |
Since the documentation text blob might be gzipped, it needs to search for what to output in a streaming manner. It then first searches for "\nALL OPTIONS". Then, it looks for the start to display at "\n -[option]" and stops again at "\n -". Except for the last option in the man page, which ends at "\nFILES" - the subtitle for the section following all options in the manpage. Test 1707 to 1710 verify Closes #13997
c02992d
to
f5e0015
Compare
The extracting of the help texts is still a little crude: because we typically have 270KB of text zlib compressed into a single blob, we have to scan for the text to show.
The searching can be made to use Boyer-Moore or similar to speed things up but leaving that for later.
Tasks
--no-alpn
--no-
prefix for boolean options--no-
prefix for non-boolean options--keepalive
- do not match--keepalive-cnt
(works because of the alpha sorting)^ --
combo before the first option in the manpageExample command lines.
Short cmdline option
Long cmdline option
Non-existing cmdline option