tool_listhelp: easier to generate with gen.pl - #7787
Closed
bagder wants to merge 2 commits into
Closed
Conversation
Contributor
|
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 |
bagder
force-pushed
the
bagder/tool_listhelp
branch
from
September 29, 2021 10:34
cb6b7de to
8588a26
Compare
Member
Author
|
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. |
Member
Author
|
See #7792 for how I took your proposal a little further. |
Contributor
Ok, fine. But maybe that could generate too much indent. Like in |
Member
Author
|
Yes, which is why I attempted to only do it as wide as it can without wrapping... |
bagder
added a commit
that referenced
this pull request
Sep 29, 2021
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
bagder
force-pushed
the
bagder/tool_listhelp
branch
from
September 29, 2021 12:21
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
bagder
force-pushed
the
bagder/tool_listhelp
branch
from
September 30, 2021 07:41
1b6504a to
345f6bd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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