diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-03-19 17:06:56 +0000 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-03-19 11:01:49 -0700 |
commit | 25c2a76d103dfc79b2344eca8d4500a9775e7d89 (patch) | |
tree | 32c0f66256322e5b809ca4e7580750c6f48c43c1 /Userland/Libraries/LibMain/Main.h | |
parent | 60c228b914b52172a711c762bb4054c65d9bf0d6 (diff) | |
download | serenity-25c2a76d103dfc79b2344eca8d4500a9775e7d89.zip |
LibMain: Add the ability to configure the exit code on error
Some POSIX utilities are specified to return a specific value on error,
which is not 1. `Main::set_return_code_for_errors()` lets you set it to
that value.
Diffstat (limited to 'Userland/Libraries/LibMain/Main.h')
-rw-r--r-- | Userland/Libraries/LibMain/Main.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibMain/Main.h b/Userland/Libraries/LibMain/Main.h index bc66c1aac3..9fee321b8d 100644 --- a/Userland/Libraries/LibMain/Main.h +++ b/Userland/Libraries/LibMain/Main.h @@ -19,6 +19,9 @@ struct Arguments { Span<StringView> strings; }; +int return_code_for_errors(); +void set_return_code_for_errors(int); + } ErrorOr<int> serenity_main(Main::Arguments); |