initctl: don't fall back to default command for wrong commands

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2021-03-12 16:48:58 +01:00
1 parent e8b942cf95
commit 2385a1209b
1 file changed
+3
+3
View File
@@ -942,6 +942,9 @@ static int cmd_parse(int argc, char *argv[], struct cmd *command)
} }
} }
if (argv[0] && strlen(argv[0]) > 0)
errx(1, "No such command. See 'initctl help' for an overview of available commands.");
return command[0].cb(NULL); /* default cmd */ return command[0].cb(NULL); /* default cmd */
} }