Implement soft delete
[wimlib] / programs / imagex.c
index 4e5765f649b2b650da84dfd1b47fd0b9ad199dd2..d047130b20b395983283ce21b5619448954734da 100644 (file)
@@ -77,7 +77,7 @@ static const char *usage_strings[] = {
 "                      [--flags EDITION_ID] [--verbose] [--dereference]\n"
 "                      [--config=FILE] [--threads=NUM_THREADS]\n",
 [DELETE] =
-"imagex delete WIMFILE (IMAGE_NUM | IMAGE_NAME | all) [--check]\n",
+"imagex delete WIMFILE (IMAGE_NUM | IMAGE_NAME | all) [--check] [--soft]\n",
 [DIR] =
 "imagex dir WIMFILE (IMAGE_NUM | IMAGE_NAME | all)\n",
 [EXPORT] =
@@ -134,6 +134,7 @@ static const struct option capture_or_append_options[] = {
 };
 static const struct option delete_options[] = {
        {"check", no_argument, NULL, 'c'},
+       {"soft",  no_argument, NULL, 's'},
        {NULL, 0, NULL, 0},
 };
 
@@ -675,6 +676,9 @@ static int imagex_delete(int argc, const char **argv)
                        open_flags |= WIMLIB_OPEN_FLAG_CHECK_INTEGRITY;
                        write_flags |= WIMLIB_WRITE_FLAG_CHECK_INTEGRITY;
                        break;
+               case 's':
+                       write_flags |= WIMLIB_WRITE_FLAG_SOFT_DELETE;
+                       break;
                default:
                        usage(DELETE);
                        return -1;