mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
dirname: Port to LibMain
This commit is contained in:
parent
4726532735
commit
a35f51f0f0
Notes:
sideshowbarker
2024-07-17 22:44:11 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/a35f51f0f01 Pull-request: https://github.com/SerenityOS/serenity/pull/11253 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/bgianfo ✅
@ -82,6 +82,7 @@ target_link_libraries(dd LibMain)
|
||||
target_link_libraries(ddate LibMain)
|
||||
target_link_libraries(df LibMain)
|
||||
target_link_libraries(diff LibDiff LibMain)
|
||||
target_link_libraries(dirname LibMain)
|
||||
target_link_libraries(disasm LibX86)
|
||||
target_link_libraries(dmesg LibMain)
|
||||
target_link_libraries(echo LibMain)
|
||||
|
@ -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…
Reference in New Issue
Block a user