@@ -148,6 +148,10 @@ static bool parsePlatformName(const std::string& value, EnginePlatform& out) {
148148 return false ;
149149}
150150
151+ static bool isAllPlatformsToken (const std::string& value) {
152+ return normalizeToken (value) == " all" ;
153+ }
154+
151155static bool parseShaderOutputFormat (const std::string& value, ShaderOutputFormat& out) {
152156 const std::string token = normalizeToken (value);
153157 if (token == " binary" || token == " sdat" ) {
@@ -254,8 +258,7 @@ static void printUsage(const std::string& commandName) {
254258 << " --assets <path> Asset directory, relative to the project or absolute.\n "
255259 << " --lua <path> Lua directory, relative to the project or absolute.\n "
256260 << " --start-scene <id|name> Start scene override.\n "
257- << " --platform <list> linux, windows, macos, ios, web, android. Can repeat.\n "
258- << " --all-platforms Export shader formats for every supported platform.\n "
261+ << " --platform <list> linux, windows, macos, ios, web, android, all. Can repeat.\n "
259262 << " --shader <spec> Shader type and optional properties, e.g. mesh:Uv1,Nor. Can repeat.\n "
260263 << " --list-scenes Print project scenes and exit.\n "
261264 << " -h, --help Show this help.\n\n "
@@ -271,8 +274,7 @@ static void printShadersUsage(const std::string& commandName) {
271274 << " Options:\n "
272275 << " -o, --out <path> Destination directory for generated shader files.\n "
273276 << " --format <format> binary, header, or json. Default: binary.\n "
274- << " --platform <list> linux, windows, macos, ios, web, android. Can repeat.\n "
275- << " --all-platforms Generate shader formats for every supported platform.\n "
277+ << " --platform <list> linux, windows, macos, ios, web, android, all. Can repeat.\n "
276278 << " --shader <spec> Shader type and optional properties, e.g. mesh:Uv1,Nor. Can repeat.\n "
277279 << " -h, --help Show this help.\n\n "
278280 << " If no --platform is provided, all supported platforms are used.\n "
@@ -313,15 +315,18 @@ static bool parseArgs(int argc, char** argv, ExportCliOptions& options, std::str
313315 } else if (arg == " --platform" ) {
314316 if (!requireValue (argc, argv, i, value, error)) return false ;
315317 for (const std::string& name : splitList (value)) {
318+ if (isAllPlatformsToken (name)) {
319+ addAllSupportedPlatforms (options.platforms );
320+ continue ;
321+ }
322+
316323 EnginePlatform platform;
317324 if (!parsePlatformName (name, platform)) {
318325 error = " Unknown platform: " + name;
319326 return false ;
320327 }
321328 options.platforms .insert (platform);
322329 }
323- } else if (arg == " --all-platforms" ) {
324- addAllSupportedPlatforms (options.platforms );
325330 } else if (arg == " --shader" ) {
326331 if (!requireValue (argc, argv, i, value, error)) return false ;
327332 ShaderKey key;
@@ -374,15 +379,18 @@ static bool parseShadersArgs(int argc, char** argv, ShaderCliOptions& options, s
374379 } else if (arg == " --platform" ) {
375380 if (!requireValue (argc, argv, i, value, error)) return false ;
376381 for (const std::string& name : splitList (value)) {
382+ if (isAllPlatformsToken (name)) {
383+ addAllSupportedPlatforms (options.platforms );
384+ continue ;
385+ }
386+
377387 EnginePlatform platform;
378388 if (!parsePlatformName (name, platform)) {
379389 error = " Unknown platform: " + name;
380390 return false ;
381391 }
382392 options.platforms .insert (platform);
383393 }
384- } else if (arg == " --all-platforms" ) {
385- addAllSupportedPlatforms (options.platforms );
386394 } else if (arg == " --shader" ) {
387395 if (!requireValue (argc, argv, i, value, error)) return false ;
388396 ShaderKey key;
0 commit comments