summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraidanfnv <aidanf@nvidia.com>2025-07-10 20:16:08 -0700
committerGitHub <noreply@github.com>2025-07-11 03:16:08 +0000
commit6f11c50ba101948b110aa7310fc4fb5732b2b708 (patch)
tree2be632853e8226593b238dcf2617ac9a26d61af3
parent850df7913a17ec47f7fde12083d0d3e55170cc7b (diff)
Only append slangc --help value categories if explicitly specified (#7712)
* Only append --help value categories if explictly specified * Add consistent help-category list, omit help-category category * Fix formatting * Add missing indent
-rw-r--r--source/core/slang-command-options-writer.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/source/core/slang-command-options-writer.cpp b/source/core/slang-command-options-writer.cpp
index 1f1de029d..a0308c971 100644
--- a/source/core/slang-command-options-writer.cpp
+++ b/source/core/slang-command-options-writer.cpp
@@ -502,7 +502,13 @@ void TextCommandOptionsWriter::appendDescriptionImpl()
const auto& categories = m_commandOptions->getCategories();
for (Index categoryIndex = 0; categoryIndex < categories.getCount(); ++categoryIndex)
{
- _appendDescriptionForCategory(categoryIndex);
+ const auto& category = categories[categoryIndex];
+
+ // Omit the value categories
+ if (category.kind != CategoryKind::Value)
+ {
+ _appendDescriptionForCategory(categoryIndex);
+ }
}
// Add instructions for getting help for specific categories
@@ -510,7 +516,16 @@ void TextCommandOptionsWriter::appendDescriptionImpl()
m_builder << "=====================================\n\n";
m_builder << "To get help for a specific category of options or values, use: slangc -h "
"<help-category>\n";
- m_builder << "See the <help-category> section above for the list of categories.\n\n";
+ m_builder << m_options.indent << "<help-category> can be: ";
+
+ List<UnownedStringSlice> categoryNames;
+ for (const auto& category : categories)
+ {
+ categoryNames.add(category.name);
+ }
+
+ _appendWrappedIndented(1, categoryNames, toSlice(", "));
+ m_builder << "\n\n";
}
void TextCommandOptionsWriter::_appendDescriptionForCategory(Index categoryIndex)