mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
comm: Port to LibMain :^)
This commit is contained in:
parent
d86c84a700
commit
601b60324a
Notes:
sideshowbarker
2024-07-18 05:01:22 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/601b60324a3 Pull-request: https://github.com/SerenityOS/serenity/pull/11101 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/bgianfo ✅ Reviewed-by: https://github.com/creator1creeper1 ✅ Reviewed-by: https://github.com/kleinesfilmroellchen ✅
2 changed files with 6 additions and 6 deletions
|
@ -69,6 +69,7 @@ target_link_libraries(chown LibMain)
|
|||
target_link_libraries(chres LibGUI LibMain)
|
||||
target_link_libraries(cksum LibCrypto LibMain)
|
||||
target_link_libraries(clear LibMain)
|
||||
target_link_libraries(comm LibMain)
|
||||
target_link_libraries(config LibConfig)
|
||||
target_link_libraries(copy LibGUI LibMain)
|
||||
target_link_libraries(cp LibMain)
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#include <LibCore/ArgsParser.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibMain/Main.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
|
@ -14,12 +16,9 @@
|
|||
#define COL2_COLOR "\x1B[34m{}\x1B[0m"
|
||||
#define COL3_COLOR "\x1B[31m{}\x1B[0m"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
if (pledge("stdio rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||
|
||||
String file1_path, file2_path;
|
||||
bool suppress_col1 { false };
|
||||
|
@ -41,7 +40,7 @@ int main(int argc, char** argv)
|
|||
args_parser.add_option(print_total, "Print a summary", "total", 't');
|
||||
args_parser.add_positional_argument(file1_path, "First file to compare", "file1");
|
||||
args_parser.add_positional_argument(file2_path, "Second file to compare", "file2");
|
||||
args_parser.parse(argc, argv);
|
||||
args_parser.parse(arguments);
|
||||
|
||||
if (color && no_color) {
|
||||
warnln("Cannot specify 'color' and 'no-color' together");
|
||||
|
|
Loading…
Reference in a new issue