vlib: rewrite vlib/v/help
, fix print_help_and_exit
for sub topics
#19672
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.
Currently, when running
v fmt --help
it prints:This is despite vfmt accepting a help flag and calling the print_help function:
v/cmd/tools/vfmt.v
Lines 90 to 91 in f705897
This PR fixes it and extends the modules test coverage and better error information.
It is a small module so it was rewritten to improve the module's suboptimalities.
As a note when testing the changes locally: it's required to re-run
v self
to include when checking out the branch.🤖 Generated by Copilot at 7a7a403
This pull request refactors and improves the
help
andhelp_test
modules in the V standard library. It uses new compiler attributes to get the paths to the V executable and the help topics, simplifies the code logic and structure, and adds more test cases.🤖 Generated by Copilot at 7a7a403
print_and_exit
function to use the new attributes and helper functions (link)help_test
module to use the new attributes and theos.quoted_path
function (link, link)test_all_help
function totest_all_topics
and add two new test functions (link)test_all_topics
(link)