summaryrefslogtreecommitdiffstats
path: root/main/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.cpp')
-rw-r--r--main/main.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 75797e31de..792ecf2f8f 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -659,6 +659,8 @@ void Main::print_help(const char *p_binary) {
print_help_option("", "The target directory must exist.\n");
print_help_option("--export-debug <preset> <path>", "Export the project in debug mode using the given preset and output path. See --export-release description for other considerations.\n", CLI_OPTION_AVAILABILITY_EDITOR);
print_help_option("--export-pack <preset> <path>", "Export the project data only using the given preset and output path. The <path> extension determines whether it will be in PCK or ZIP format.\n", CLI_OPTION_AVAILABILITY_EDITOR);
+ print_help_option("--export-patch <preset> <path>", "Export pack with changed files only. See --export-pack description for other considerations.\n", CLI_OPTION_AVAILABILITY_EDITOR);
+ print_help_option("--patches <paths>", "List of patches to use with --export-patch. The list is comma-separated.\n", CLI_OPTION_AVAILABILITY_EDITOR);
print_help_option("--install-android-build-template", "Install the Android build template. Used in conjunction with --export-release or --export-debug.\n", CLI_OPTION_AVAILABILITY_EDITOR);
#ifndef DISABLE_DEPRECATED
// Commands are long; split the description to a second line.
@@ -1478,12 +1480,23 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
wait_for_import = true;
quit_after = 1;
} else if (arg == "--export-release" || arg == "--export-debug" ||
- arg == "--export-pack") { // Export project
+ arg == "--export-pack" || arg == "--export-patch") { // Export project
// Actually handling is done in start().
editor = true;
cmdline_tool = true;
wait_for_import = true;
main_args.push_back(arg);
+ } else if (arg == "--patches") {
+ if (N) {
+ // Actually handling is done in start().
+ main_args.push_back(arg);
+ main_args.push_back(N->get());
+
+ N = N->next();
+ } else {
+ OS::get_singleton()->print("Missing comma-separated list of patches after --patches, aborting.\n");
+ goto error;
+ }
#ifndef DISABLE_DEPRECATED
} else if (arg == "--export") { // For users used to 3.x syntax.
OS::get_singleton()->print("The Godot 3 --export option was changed to more explicit --export-release / --export-debug / --export-pack options.\nSee the --help output for details.\n");
@@ -3489,9 +3502,11 @@ int Main::start() {
bool doc_tool_implicit_cwd = false;
BitField<DocTools::GenerateFlags> gen_flags;
String _export_preset;
+ Vector<String> patches;
bool export_debug = false;
bool export_pack_only = false;
bool install_android_build_template = false;
+ bool export_patch = false;
#ifdef MODULE_GDSCRIPT_ENABLED
String gdscript_docs_path;
#endif
@@ -3581,6 +3596,14 @@ int Main::start() {
editor = true;
_export_preset = E->next()->get();
export_pack_only = true;
+ } else if (E->get() == "--export-patch") {
+ ERR_FAIL_COND_V_MSG(!editor && !found_project, EXIT_FAILURE, "Please provide a valid project path when exporting, aborting.");
+ editor = true;
+ _export_preset = E->next()->get();
+ export_pack_only = true;
+ export_patch = true;
+ } else if (E->get() == "--patches") {
+ patches = E->next()->get().split(",", false);
#endif
} else {
// The parameter does not match anything known, don't skip the next argument
@@ -3984,7 +4007,7 @@ int Main::start() {
sml->get_root()->add_child(editor_node);
if (!_export_preset.is_empty()) {
- editor_node->export_preset(_export_preset, positional_arg, export_debug, export_pack_only, install_android_build_template);
+ editor_node->export_preset(_export_preset, positional_arg, export_debug, export_pack_only, install_android_build_template, export_patch, patches);
game_path = ""; // Do not load anything.
}