2020-08-10 14:41:35 -04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 04:24:48 -04:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-08-10 14:41:35 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <AK/LexicalPath.h>
|
|
|
|
#include <LibCore/ArgsParser.h>
|
2021-12-07 15:28:21 -05:00
|
|
|
#include <LibMain/Main.h>
|
2020-08-10 14:41:35 -04:00
|
|
|
|
2021-12-07 15:28:21 -05:00
|
|
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
2020-08-10 14:41:35 -04:00
|
|
|
{
|
2021-12-07 15:28:21 -05:00
|
|
|
String path = {};
|
2020-08-10 14:41:35 -04:00
|
|
|
Core::ArgsParser args_parser;
|
|
|
|
args_parser.add_positional_argument(path, "Path", "path");
|
2021-12-07 15:28:21 -05:00
|
|
|
args_parser.parse(arguments);
|
2020-08-10 14:41:35 -04:00
|
|
|
|
2021-06-29 10:46:16 -04:00
|
|
|
outln("{}", LexicalPath::dirname(path));
|
2020-08-10 14:41:35 -04:00
|
|
|
return 0;
|
|
|
|
}
|