diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index 713fcf092d6..cb3e8aa9080 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -572,6 +572,16 @@ A failed sanitize operation can only be exited if it was run in the unrestricted completion mode, as provided by the .Fl U argument. +.It 1, 2, 3, 4 +nvme-cli compatible +.Fl a +values for +.Dq exitfailure , +.Dq block , +.Dq overwrite , +and +.Dq crypto +respectively. .El .It Fl c Ar passes The number of passes when performing an diff --git a/sbin/nvmecontrol/sanitize.c b/sbin/nvmecontrol/sanitize.c index ba89e138db8..e720c6d4349 100644 --- a/sbin/nvmecontrol/sanitize.c +++ b/sbin/nvmecontrol/sanitize.c @@ -130,8 +130,11 @@ sanitize(const struct cmd *f, int argc, char *argv[]) sanact = 3; else if (strcmp(opt.sanact, "crypto") == 0) sanact = 4; + else if ((sanact = (int)strtol(opt.sanact, NULL, 10) != 0) + && (sanact >= 1 && sanact <= 4)) + ; /* compat with nvme sanitize -a number */ else { - fprintf(stderr, "Incorrect Sanitize Action value\n"); + fprintf(stderr, "Incorrect Sanitize Action value: %s\n", opt.sanact); arg_help(argc, argv, f); } }