1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 08:28:11 +00:00

dirname: Port to LibMain

This commit is contained in:
Kenneth Myhra 2021-12-07 21:28:21 +01:00 committed by Brian Gianforcaro
parent 4726532735
commit a35f51f0f0
2 changed files with 5 additions and 3 deletions

View file

@ -6,13 +6,14 @@
#include <AK/LexicalPath.h>
#include <LibCore/ArgsParser.h>
#include <LibMain/Main.h>
int main(int argc, char** argv)
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
const char* path = nullptr;
String path = {};
Core::ArgsParser args_parser;
args_parser.add_positional_argument(path, "Path", "path");
args_parser.parse(argc, argv);
args_parser.parse(arguments);
outln("{}", LexicalPath::dirname(path));
return 0;