summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-options.cpp
diff options
context:
space:
mode:
authoraidanfnv <aidanf@nvidia.com>2025-07-08 13:41:56 -0700
committerGitHub <noreply@github.com>2025-07-08 20:41:56 +0000
commit0ab515159e9da15e0077d55c761ca0f326361257 (patch)
tree845185acb6a753c1ec99ba6970c1d23936399fcc /source/slang/slang-options.cpp
parente52885347076f3dfbf96cb5b898fabf9b4c9562d (diff)
Add <help-category> 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 <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-options.cpp')
-rw-r--r--source/slang/slang-options.cpp18
1 files changed, 18 insertions, 0 deletions
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");