Skip to content

Commit 135629f

Browse files
committed
Added hidden destructive option "-d DESTROY" to avoid hanging on a prompt when an unreadable sector has been found.
1 parent 8e638e4 commit 135629f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

hdrecover.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,21 @@ int main(int argc, char **argv, char **envp)
171171
int64_t logical_end_block = 0;
172172

173173
int opt;
174-
while ((opt = getopt(argc, argv, "s:e:")) != -1) {
174+
while ((opt = getopt(argc, argv, "s:e:d:")) != -1) {
175175
switch (opt) {
176176
case 's':
177177
logical_start_block = atoll(optarg);
178178
break;
179179
case 'e':
180180
logical_end_block = atoll(optarg);
181181
break;
182+
case 'd':
183+
if (!strcmp("DESTROY", optarg)) {
184+
confirm_all = true;
185+
shown_big_warning = true;
186+
printf("Destructive mode enabled!\n");
187+
}
188+
break;
182189
default:
183190
usage();
184191
}

0 commit comments

Comments
 (0)