@@ -1044,17 +1044,17 @@ static void print_help_obscure()
10441044 // clang-format on
10451045}
10461046
1047- static void print_help ()
1047+ static void print_help_all ()
10481048{
10491049 print_version ();
10501050
10511051 // clang-format off
1052- fprintf (stderr, " Usage: spirv-cross <...> \n "
1052+ fprintf (stderr, " Usage: spirv-cross [SPIR-V file] [options] \n "
10531053 " \n Basic:\n "
10541054 " \t [SPIR-V file] (- is stdin)\n "
10551055 " \t [--output <output path>]: If not provided, prints output to stdout.\n "
10561056 " \t [--dump-resources]:\n\t\t Prints a basic reflection of the SPIR-V module along with other output.\n "
1057- " \t [--help]:\n\t\t Prints this help message.\n "
1057+ " \t [--help]:\n\t\t Prints a summary help message.\n "
10581058 );
10591059 // clang-format on
10601060
@@ -1066,6 +1066,33 @@ static void print_help()
10661066 print_help_obscure ();
10671067}
10681068
1069+ static void print_help ()
1070+ {
1071+ print_version ();
1072+
1073+ // clang-format off
1074+ fprintf (stderr, " Usage: spirv-cross [SPIR-V file] [options]\n "
1075+ " \n Basic:\n "
1076+ " \t [SPIR-V file] (- is stdin)\n "
1077+ " \t [--output <output path>]: If not provided, prints output to stdout.\n "
1078+ " \t [--help]:\n\t\t Prints this summary help message.\n "
1079+ " \t [--help-all]:\n\t\t Prints all available help options.\n "
1080+ );
1081+ // clang-format on
1082+
1083+ print_help_backend ();
1084+ print_help_common ();
1085+
1086+ // clang-format off
1087+ fprintf (stderr, " \n Help Categories:\n "
1088+ " \t [--help-glsl]\n "
1089+ " \t [--help-msl]\n "
1090+ " \t [--help-hlsl]\n "
1091+ " \t [--help-obscure]\n "
1092+ );
1093+ // clang-format on
1094+ }
1095+
10691096static bool remap_generic (Compiler &compiler, const SmallVector<Resource> &resources, const Remap &remap)
10701097{
10711098 auto itr =
@@ -1610,6 +1637,34 @@ static int main_inner(int argc, char *argv[])
16101637 print_help ();
16111638 parser.end ();
16121639 });
1640+ cbs.add (" --help-all" , [](CLIParser &parser) {
1641+ print_help_all ();
1642+ parser.end ();
1643+ });
1644+ cbs.add (" --help-backend" , [](CLIParser &parser) {
1645+ print_help_backend ();
1646+ parser.end ();
1647+ });
1648+ cbs.add (" --help-common" , [](CLIParser &parser) {
1649+ print_help_common ();
1650+ parser.end ();
1651+ });
1652+ cbs.add (" --help-glsl" , [](CLIParser &parser) {
1653+ print_help_glsl ();
1654+ parser.end ();
1655+ });
1656+ cbs.add (" --help-msl" , [](CLIParser &parser) {
1657+ print_help_msl ();
1658+ parser.end ();
1659+ });
1660+ cbs.add (" --help-hlsl" , [](CLIParser &parser) {
1661+ print_help_hlsl ();
1662+ parser.end ();
1663+ });
1664+ cbs.add (" --help-obscure" , [](CLIParser &parser) {
1665+ print_help_obscure ();
1666+ parser.end ();
1667+ });
16131668 cbs.add (" --revision" , [](CLIParser &parser) {
16141669 print_version ();
16151670 parser.end ();
0 commit comments