mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
Utilities: Port realpath to LibMain
This commit is contained in:
parent
2e87a5b7eb
commit
65de0d2910
Notes:
sideshowbarker
2024-07-17 19:04:16 +09:00
Author: https://github.com/ryangjchandler
Commit: 65de0d2910
Pull-request: https://github.com/SerenityOS/serenity/pull/12377
Reviewed-by: https://github.com/AtkinsSJ ✅
2 changed files with 6 additions and 6 deletions
|
@ -5,15 +5,14 @@
|
|||
*/
|
||||
|
||||
#include <LibCore/ArgsParser.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", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
TRY(Core::System::pledge("stdio rpath"));
|
||||
|
||||
const char* path;
|
||||
|
||||
|
@ -21,7 +20,7 @@ int main(int argc, char** argv)
|
|||
args_parser.set_general_help(
|
||||
"Show the 'real' path of a file, by resolving all symbolic links along the way.");
|
||||
args_parser.add_positional_argument(path, "Path to resolve", "path");
|
||||
args_parser.parse(argc, argv);
|
||||
args_parser.parse(arguments);
|
||||
|
||||
char* value = realpath(path, nullptr);
|
||||
if (value == nullptr) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue