diff options
author | Kenneth Myhra <kennethmyhra@gmail.com> | 2022-03-29 21:36:41 +0200 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-03-29 21:28:29 -0700 |
commit | cf154ec0d9b9a24fd086a7c606a16b8f95060aad (patch) | |
tree | cd50298afdc0b277896b04f1c0b7cdf07fa8e44b /Userland/Utilities/tt.cpp | |
parent | ab9a78a30574b62e31f06b2bba15c400ff7d8a6a (diff) | |
download | serenity-cf154ec0d9b9a24fd086a7c606a16b8f95060aad.zip |
tt: Port to LibMain
Diffstat (limited to 'Userland/Utilities/tt.cpp')
-rw-r--r-- | Userland/Utilities/tt.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Utilities/tt.cpp b/Userland/Utilities/tt.cpp index 574bd140e9..5c0929d2bd 100644 --- a/Userland/Utilities/tt.cpp +++ b/Userland/Utilities/tt.cpp @@ -5,11 +5,11 @@ */ #include <LibCore/ArgsParser.h> +#include <LibMain/Main.h> #include <errno.h> #include <pthread.h> #include <signal_numbers.h> #include <stdio.h> -#include <stdlib.h> #include <string.h> #include <sys/mman.h> #include <unistd.h> @@ -22,7 +22,7 @@ static int staying_alive_test(); static int set_stack_test(); static int kill_test(); -int main(int argc, char** argv) +ErrorOr<int> serenity_main(Main::Arguments arguments) { const char* test_name = "n"; @@ -31,7 +31,7 @@ int main(int argc, char** argv) "Exercise error-handling and edge-case paths of the execution environment " "(i.e., Kernel or UE) by doing unusual thread-related things."); args_parser.add_positional_argument(test_name, "Test to run (m = mutex, d = detached, p = priority, s = stack size, t = simple thread test, x = set stack, k = kill, nothing = join race)", "test-name", Core::ArgsParser::Required::No); - args_parser.parse(argc, argv); + args_parser.parse(arguments); if (*test_name == 'm') return mutex_test(); @@ -48,7 +48,7 @@ int main(int argc, char** argv) if (*test_name == 'k') return kill_test(); if (*test_name != 'n') { - args_parser.print_usage(stdout, argv[0]); + args_parser.print_usage(stdout, arguments.argv[0]); return 1; } |