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
tool_listhelp: easier to generate with gen.pl #7787
Conversation
Would it be possible to make
Since Or it could be done in static void print_category(curlhelp_t category)
{
unsigned int i;
size_t len, longest = 0;
if (category & CURLHELP_IMPORTANT)
for(i = 0; helptext[i].opt; ++i) {
if(!(helptext[i].categories & CURLHELP_IMPORTANT))
continue;
len = strlen(helptext[i].opt);
if (len > longest)
longest = len;
}
else
longest = 18;
for(i = 0; helptext[i].opt; ++i)
if(helptext[i].categories & category) {
printf(" %-*s %s\n", longest, helptext[i].opt, helptext[i].desc);
}
} Edit: Maybe simply |
cb6b7de
to
8588a26
Compare
We could even do it for all categories! And since that's not really related to this change, I'll do that in a separate PR. |
See #7792 for how I took your proposal a little further. |
Ok, fine. But maybe that could generate too much indent. Like in
|
Yes, which is why I attempted to only do it as wide as it can without wrapping... |
tool_listhelp.c is now a separate file with only the command line --help output, exactly as generated by gen.pl. This makes it easier to generate updates according to what's in the docs/cmdline-opts docs. cd $srcroot/docs/cmdline-opts ./gen.pl listhelp *.d > $srcroot/src/tool_listhelp.c With a configure build, this also works: make -C src listhelp Closes #7787
8588a26
to
e7dd7fa
Compare
This comment has been minimized.
This comment has been minimized.
tool_listhelp.c is now a separate file with only the command line --help output, exactly as generated by gen.pl. This makes it easier to generate updates according to what's in the docs/cmdline-opts docs. cd $srcroot/docs/cmdline-opts ./gen.pl listhelp *.d > $srcroot/src/tool_listhelp.c With a configure build, this also works: make -C src listhelp Closes #7787
1b6504a
to
345f6bd
Compare
tool_listhelp.c is now a separate file with only the command line --help
output, exactly as generated by gen.pl. This makes it easier to generate
updates according to what's in the docs/cmdline-opts docs.
cd $srcroot/docs/cmdline-opts
./gen.pl listhelp *.d > $srcroot/src/tool_listhelp.c