diff options
author | Linus Groh <mail@linusgroh.de> | 2021-06-01 19:27:59 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-06-01 21:30:16 +0100 |
commit | 2a940464b864e59ff0ea0e942ff4c61c68016a31 (patch) | |
tree | 60c23aa4e809565764126ce11684b9e7aa97e0e8 /Userland/Utilities | |
parent | f5c35fccca3394ae54647d89a160d599f4a74f04 (diff) | |
download | serenity-2a940464b864e59ff0ea0e942ff4c61c68016a31.zip |
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.
Diffstat (limited to 'Userland/Utilities')
-rw-r--r-- | Userland/Utilities/chown.cpp | 2 | ||||
-rw-r--r-- | Userland/Utilities/fgrep.cpp | 2 | ||||
-rw-r--r-- | Userland/Utilities/flock.cpp | 2 | ||||
-rw-r--r-- | Userland/Utilities/gron.cpp | 2 | ||||
-rw-r--r-- | Userland/Utilities/mknod.cpp | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Utilities/chown.cpp b/Userland/Utilities/chown.cpp index 7f29202d1f..a3e69dacde 100644 --- a/Userland/Utilities/chown.cpp +++ b/Userland/Utilities/chown.cpp @@ -22,7 +22,7 @@ int main(int argc, char** argv) if (argc < 3) { warnln("usage: chown <uid[:gid]> <path>"); - return 0; + return 1; } uid_t new_uid = -1; diff --git a/Userland/Utilities/fgrep.cpp b/Userland/Utilities/fgrep.cpp index c4ddfeaa8f..639533ac8b 100644 --- a/Userland/Utilities/fgrep.cpp +++ b/Userland/Utilities/fgrep.cpp @@ -14,7 +14,7 @@ int main(int argc, char** argv) { if (argc < 2) { warnln("usage: fgrep <str>"); - return 0; + return 1; } for (;;) { char buf[4096]; diff --git a/Userland/Utilities/flock.cpp b/Userland/Utilities/flock.cpp index f8678e7ed9..0172d16f58 100644 --- a/Userland/Utilities/flock.cpp +++ b/Userland/Utilities/flock.cpp @@ -16,7 +16,7 @@ int main(int argc, char** argv) { if (argc < 3) { warnln("usage: flock <path> <command...>"); - return 0; + return 1; } pid_t child_pid; diff --git a/Userland/Utilities/gron.cpp b/Userland/Utilities/gron.cpp index 58bf1e2c7b..1008df60fc 100644 --- a/Userland/Utilities/gron.cpp +++ b/Userland/Utilities/gron.cpp @@ -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)) { diff --git a/Userland/Utilities/mknod.cpp b/Userland/Utilities/mknod.cpp index 5f68894d8f..b0317f3fc6 100644 --- a/Userland/Utilities/mknod.cpp +++ b/Userland/Utilities/mknod.cpp @@ -18,7 +18,7 @@ constexpr unsigned encoded_device(unsigned major, unsigned minor) static int usage() { warnln("usage: mknod <name> <c|b|p> [<major> <minor>]"); - return 0; + return 1; } int main(int argc, char** argv) |