Exit with usage when extra arguments are on command line
preventing mistakes such as "halt 0p" for "halt -p". Approved by: bde (mentor), phk (mentor) MFC after: 1 week
This commit is contained in:
parent
5f1547e410
commit
0b35cef2b2
@ -116,6 +116,8 @@ main(int argc, char *argv[])
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
if (argc != 0)
|
||||
usage();
|
||||
|
||||
if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT))
|
||||
errx(1, "cannot dump (-d) when halting; must reboot instead");
|
||||
|
Loading…
x
Reference in New Issue
Block a user