mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
nl: Port to LibMain
This commit is contained in:
parent
cf207ad938
commit
a64b44377d
2 changed files with 4 additions and 2 deletions
|
@ -138,6 +138,7 @@ target_link_libraries(mv LibMain)
|
|||
target_link_libraries(mount LibMain)
|
||||
target_link_libraries(nc LibMain)
|
||||
target_link_libraries(netstat LibMain)
|
||||
target_link_libraries(nl LibMain)
|
||||
target_link_libraries(notify LibGUI)
|
||||
target_link_libraries(nproc LibMain)
|
||||
target_link_libraries(open LibDesktop)
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue