Userland: Make test exit 1 silently when no arguments are given

This commit is contained in:
Peter Elliott 2020-07-15 09:00:53 -06:00 committed by Andreas Kling
parent acfae91032
commit 16fd5753eb
Notes: sideshowbarker 2024-07-19 04:46:54 +09:00

View File

@ -521,6 +521,10 @@ int main(int argc, char* argv[])
argv[argc] = nullptr;
}
// Exit false when no arguments are given.
if (argc == 1)
return 1;
auto condition = parse_complex_expression(argv);
if (optind != argc - 1)
fatal_error("Too many arguments");