From 6f11c50ba101948b110aa7310fc4fb5732b2b708 Mon Sep 17 00:00:00 2001 From: aidanfnv Date: Thu, 10 Jul 2025 20:16:08 -0700 Subject: 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 --- source/core/slang-command-options-writer.cpp | 19 +++++++++++++++++-- 1 file 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 " "\n"; - m_builder << "See the section above for the list of categories.\n\n"; + m_builder << m_options.indent << " can be: "; + + List categoryNames; + for (const auto& category : categories) + { + categoryNames.add(category.name); + } + + _appendWrappedIndented(1, categoryNames, toSlice(", ")); + m_builder << "\n\n"; } void TextCommandOptionsWriter::_appendDescriptionForCategory(Index categoryIndex) -- cgit v1.2.3