mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:58:11 +00:00
Utilities/ln: Port to LibMain
This patch simply ports the utility ln to LibMain :^)
This commit is contained in:
parent
81492b3cee
commit
0ac7931545
2 changed files with 5 additions and 6 deletions
|
@ -110,6 +110,7 @@ target_link_libraries(js LibJS LibLine LibMain)
|
||||||
link_with_unicode_data(js)
|
link_with_unicode_data(js)
|
||||||
target_link_libraries(keymap LibKeyboard LibMain)
|
target_link_libraries(keymap LibKeyboard LibMain)
|
||||||
target_link_libraries(less LibMain)
|
target_link_libraries(less LibMain)
|
||||||
|
target_link_libraries(ln LibMain)
|
||||||
target_link_libraries(logout LibMain)
|
target_link_libraries(logout LibMain)
|
||||||
target_link_libraries(ls LibMain)
|
target_link_libraries(ls LibMain)
|
||||||
target_link_libraries(lspci LibPCIDB LibMain)
|
target_link_libraries(lspci LibPCIDB LibMain)
|
||||||
|
|
|
@ -6,15 +6,13 @@
|
||||||
|
|
||||||
#include <AK/LexicalPath.h>
|
#include <AK/LexicalPath.h>
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
|
#include <LibCore/System.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
ErrorOr<int> serenity_main(Main::Arguments argmuments)
|
||||||
{
|
{
|
||||||
if (pledge("stdio cpath", nullptr) < 0) {
|
TRY(Core::System::pledge("stdio cpath"));
|
||||||
perror("pledge");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool force = false;
|
bool force = false;
|
||||||
bool symbolic = false;
|
bool symbolic = false;
|
||||||
|
@ -26,7 +24,7 @@ int main(int argc, char** argv)
|
||||||
args_parser.add_option(symbolic, "Create a symlink", "symbolic", 's');
|
args_parser.add_option(symbolic, "Create a symlink", "symbolic", 's');
|
||||||
args_parser.add_positional_argument(target, "Link target", "target");
|
args_parser.add_positional_argument(target, "Link target", "target");
|
||||||
args_parser.add_positional_argument(path, "Link path", "path", Core::ArgsParser::Required::No);
|
args_parser.add_positional_argument(path, "Link path", "path", Core::ArgsParser::Required::No);
|
||||||
args_parser.parse(argc, argv);
|
args_parser.parse(argmuments);
|
||||||
|
|
||||||
String path_buffer;
|
String path_buffer;
|
||||||
if (!path) {
|
if (!path) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue