mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
comm: Port to LibMain :^)
This commit is contained in:
parent
d86c84a700
commit
601b60324a
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(chres LibGUI LibMain)
|
||||||
target_link_libraries(cksum LibCrypto LibMain)
|
target_link_libraries(cksum LibCrypto LibMain)
|
||||||
target_link_libraries(clear LibMain)
|
target_link_libraries(clear LibMain)
|
||||||
|
target_link_libraries(comm LibMain)
|
||||||
target_link_libraries(config LibConfig)
|
target_link_libraries(config LibConfig)
|
||||||
target_link_libraries(copy LibGUI LibMain)
|
target_link_libraries(copy LibGUI LibMain)
|
||||||
target_link_libraries(cp LibMain)
|
target_link_libraries(cp LibMain)
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
#include <LibCore/File.h>
|
#include <LibCore/File.h>
|
||||||
|
#include <LibCore/System.h>
|
||||||
|
#include <LibMain/Main.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -14,12 +16,9 @@
|
||||||
#define COL2_COLOR "\x1B[34m{}\x1B[0m"
|
#define COL2_COLOR "\x1B[34m{}\x1B[0m"
|
||||||
#define COL3_COLOR "\x1B[31m{}\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) {
|
TRY(Core::System::pledge("stdio rpath", nullptr));
|
||||||
perror("pledge");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
String file1_path, file2_path;
|
String file1_path, file2_path;
|
||||||
bool suppress_col1 { false };
|
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_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(file1_path, "First file to compare", "file1");
|
||||||
args_parser.add_positional_argument(file2_path, "Second file to compare", "file2");
|
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) {
|
if (color && no_color) {
|
||||||
warnln("Cannot specify 'color' and 'no-color' together");
|
warnln("Cannot specify 'color' and 'no-color' together");
|
||||||
|
|
Loading…
Add table
Reference in a new issue