From 0ab515159e9da15e0077d55c761ca0f326361257 Mon Sep 17 00:00:00 2001 From: aidanfnv Date: Tue, 8 Jul 2025 13:41:56 -0700 Subject: Add list and hint on usage in slangc -h (#7638) * Add category list at end of slangc -h output * Use value category for categories * format code (#12) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> * Regenerate cmdline reference --------- Co-authored-by: slangbot Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- source/slang/slang-options.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source/slang') diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index 1b8a45401..af799839c 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -344,6 +344,24 @@ void initCommandOptions(CommandOptions& options) options.addValues(pairs, SLANG_COUNT_OF(pairs)); } + /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! help-category !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ + + { + options.addCategory( + CategoryKind::Value, + "help-category", + "Available help categories for the -h option"); + + // Add all existing categories as valid help category values + const auto& categories = options.getCategories(); + for (Index categoryIndex = 0; categoryIndex < categories.getCount(); ++categoryIndex) + { + const auto& category = categories[categoryIndex]; + options.addValue(category.name, category.description); + } + } + + /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! General !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ options.setCategory("General"); -- cgit v1.2.3