mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:17:34 +00:00
Utilities: Port realpath to LibMain
This commit is contained in:
parent
2e87a5b7eb
commit
65de0d2910
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