Skip to content

Commit

Permalink
cmd/erase: make erase confirmation optional at compile-time
Browse files Browse the repository at this point in the history
JIRA: NIL-550
  • Loading branch information
nalajcie committed Sep 12, 2024
1 parent 12d2dfa commit 296a9d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmds/erase.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ static int cmd_erase(int argc, char *argv[])
return CMD_EXIT_FAILURE;
}

#ifdef PLO_ERASE_NEEDS_CONFIRMATION
res = lib_promptConfirm("\nWARNING!\nSerious risk of data loss, type %s to proceed.\n", "YES!", 10 * 1000);
if (res != 1) {
lib_printf("Aborted.\n");
return CMD_EXIT_SUCCESS;
}
#endif

res = phfs_erase(h, offs, len, 0);
if (res < 0) {
Expand Down

0 comments on commit 296a9d4

Please sign in to comment.