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:
parent
4726532735
commit
a35f51f0f0
2 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue