mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 14:14:45 +03:00
cp: Port to LibMain :^)
This commit is contained in:
parent
f1cc3d0fc4
commit
0b8fb8358e
Notes:
sideshowbarker
2024-07-18 00:38:45 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0b8fb8358e2
@ -64,6 +64,7 @@ target_link_libraries(chres LibGUI)
|
||||
target_link_libraries(cksum LibCrypto)
|
||||
target_link_libraries(config LibConfig)
|
||||
target_link_libraries(copy LibGUI LibMain)
|
||||
target_link_libraries(cp LibMain)
|
||||
target_link_libraries(diff LibDiff)
|
||||
target_link_libraries(disasm LibX86)
|
||||
target_link_libraries(dmesg LibMain)
|
||||
|
@ -7,15 +7,14 @@
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <LibCore/ArgsParser.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibMain/Main.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
if (pledge("stdio rpath wpath cpath fattr chown", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
TRY(Core::System::pledge("stdio rpath wpath cpath fattr chown", nullptr));
|
||||
|
||||
bool link = false;
|
||||
bool preserve = false;
|
||||
@ -32,15 +31,12 @@ int main(int argc, char** argv)
|
||||
args_parser.add_option(verbose, "Verbose", "verbose", 'v');
|
||||
args_parser.add_positional_argument(sources, "Source file paths", "source");
|
||||
args_parser.add_positional_argument(destination, "Destination file path", "destination");
|
||||
args_parser.parse(argc, argv);
|
||||
args_parser.parse(arguments);
|
||||
|
||||
if (preserve) {
|
||||
umask(0);
|
||||
} else {
|
||||
if (pledge("stdio rpath wpath cpath fattr", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
TRY(Core::System::pledge("stdio rpath wpath cpath fattr", nullptr));
|
||||
}
|
||||
|
||||
bool destination_is_existing_dir = Core::File::is_directory(destination);
|
||||
|
Loading…
Reference in New Issue
Block a user