diff options
Diffstat (limited to 'main/main.cpp')
-rw-r--r-- | main/main.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/main/main.cpp b/main/main.cpp index cd9bd6d1d3..ace398f9dc 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -224,6 +224,7 @@ static bool print_fps = false; #ifdef TOOLS_ENABLED static bool dump_gdextension_interface = false; static bool dump_extension_api = false; +static bool include_docs_in_extension_api_dump = false; static bool validate_extension_api = false; static String validate_extension_api_file; #endif @@ -513,7 +514,8 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --build-solutions Build the scripting solutions (e.g. for C# projects). Implies --editor and requires a valid project to edit.\n"); OS::get_singleton()->print(" --dump-gdextension-interface Generate GDExtension header file 'gdextension_interface.h' in the current folder. This file is the base file required to implement a GDExtension.\n"); OS::get_singleton()->print(" --dump-extension-api Generate JSON dump of the Godot API for GDExtension bindings named 'extension_api.json' in the current folder.\n"); - OS::get_singleton()->print(" --validate-extension-api <path> Validate an extension API file dumped (with the option above) from a previous version of the engine to ensure API compatibility. If incompatibilities or errors are detected, the return code will be non zero.\n"); + OS::get_singleton()->print(" --dump-extension-api-with-docs Generate JSON dump of the Godot API like the previous option, but including documentation.\n"); + OS::get_singleton()->print(" --validate-extension-api <path> Validate an extension API file dumped (with one of the two previous options) from a previous version of the engine to ensure API compatibility. If incompatibilities or errors are detected, the return code will be non zero.\n"); OS::get_singleton()->print(" --benchmark Benchmark the run time and print it to console.\n"); OS::get_singleton()->print(" --benchmark-file <path> Benchmark the run time and save it to a given file in JSON format. The path should be absolute.\n"); #ifdef TESTS_ENABLED @@ -1249,6 +1251,17 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // run the project instead of a cmdline tool. // Needs full refactoring to fix properly. main_args.push_back(I->get()); + } else if (I->get() == "--dump-extension-api-with-docs") { + // Register as an editor instance to use low-end fallback if relevant. + editor = true; + cmdline_tool = true; + dump_extension_api = true; + include_docs_in_extension_api_dump = true; + print_line("Dumping Extension API including documentation"); + // Hack. Not needed but otherwise we end up detecting that this should + // run the project instead of a cmdline tool. + // Needs full refactoring to fix properly. + main_args.push_back(I->get()); } else if (I->get() == "--validate-extension-api") { // Register as an editor instance to use low-end fallback if relevant. editor = true; @@ -2912,7 +2925,7 @@ bool Main::start() { } if (dump_extension_api) { - GDExtensionAPIDump::generate_extension_json_file("extension_api.json"); + GDExtensionAPIDump::generate_extension_json_file("extension_api.json", include_docs_in_extension_api_dump); } if (dump_gdextension_interface || dump_extension_api) { |