ors: Implement 'twrp format data' to format the data partition

Change-Id: Ic01685602a47d0b468616e3d5c3f26a44313cdc8
(cherry picked from commit 3b3bd12be11bd859a5f65bb1e8c71136044b3ad3)
diff --git a/openrecoveryscript.cpp b/openrecoveryscript.cpp
index 7d1db06..4d1b146 100755
--- a/openrecoveryscript.cpp
+++ b/openrecoveryscript.cpp
@@ -165,6 +165,14 @@
 					LOGERR("Error with wipe command value: '%s'\n", value);
 					ret_val = 1;
 				}
+			} else if (strcmp(command, "format") == 0) {
+				// Format
+				if (strcmp(value, "data") == 0 || strcmp(value, "/data") == 0 || strcmp(value, "factory") == 0 || strcmp(value, "factoryreset") == 0) {
+					PartitionManager.Format_Data();
+				} else {
+					LOGERR("Error with format command value: '%s'\n", value);
+					ret_val = 1;
+				}
 			} else if (strcmp(command, "backup") == 0) {
 				// Backup
 				DataManager::SetValue("tw_action_text2", gui_parse_text("{@backing}"));