1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:47:35 +00:00

Userland: Return 1 when help text is shown for insufficient args

ArgsParser also does this, but we don't use that (yet) in a couple of
places. Fix the behaviour manually for consistency.
This commit is contained in:
Linus Groh 2021-06-01 19:27:59 +01:00
parent f5c35fccca
commit 2a940464b8
5 changed files with 5 additions and 5 deletions

View file

@ -44,7 +44,7 @@ int main(int argc, char** argv)
if (argc != 2 || !strcmp(argv[1], "--help")) {
warnln("usage: gron <file>");
warnln("Print each value in a JSON file with its fully expanded key.");
return 0;
return argc != 2 ? 1 : 0;
}
auto file = Core::File::construct(argv[1]);
if (!file->open(Core::OpenMode::ReadOnly)) {