diff options
author | Kenneth Myhra <kennethmyhra@gmail.com> | 2022-01-30 11:17:58 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-31 15:25:07 +0100 |
commit | a64b44377d93c22e2b60a1e46d16d92810a58fc6 (patch) | |
tree | 3662c847eb944c1b559112fc1e4d7073017eb7dd /Userland/Utilities/nl.cpp | |
parent | cf207ad9388bdc3bb2ea539c121677f87606a57e (diff) | |
download | serenity-a64b44377d93c22e2b60a1e46d16d92810a58fc6.zip |
nl: Port to LibMain
Diffstat (limited to 'Userland/Utilities/nl.cpp')
-rw-r--r-- | Userland/Utilities/nl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Utilities/nl.cpp b/Userland/Utilities/nl.cpp index c9752be16e..28d080fdac 100644 --- a/Userland/Utilities/nl.cpp +++ b/Userland/Utilities/nl.cpp @@ -7,6 +7,7 @@ #include <AK/String.h> #include <AK/Vector.h> #include <LibCore/ArgsParser.h> +#include <LibMain/Main.h> #include <errno.h> #include <stdio.h> #include <string.h> @@ -17,7 +18,7 @@ enum NumberStyle { NumberNoLines, }; -int main(int argc, char** argv) +ErrorOr<int> serenity_main(Main::Arguments arguments) { NumberStyle number_style = NumberNonEmptyLines; int increment = 1; @@ -54,7 +55,7 @@ int main(int argc, char** argv) args_parser.add_option(start_number, "Initial line number", "startnum", 'v', "number"); args_parser.add_option(number_width, "Number width", "width", 'w', "number"); args_parser.add_positional_argument(files, "Files to process", "file", Core::ArgsParser::Required::No); - args_parser.parse(argc, argv); + args_parser.parse(arguments); Vector<FILE*> file_pointers; if (!files.is_empty()) { |