mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
readlink: Use StringView instead of const char*
This commit is contained in:
parent
45ac5e90b7
commit
546a6a80a7
Notes:
sideshowbarker
2024-07-17 16:50:43 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/546a6a80a7 Pull-request: https://github.com/SerenityOS/serenity/pull/13215 Reviewed-by: https://github.com/awesomekling
@ -14,14 +14,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
TRY(Core::System::pledge("stdio rpath"));
|
||||
|
||||
bool no_newline = false;
|
||||
Vector<const char*> paths;
|
||||
Vector<StringView> paths;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_option(no_newline, "Do not append a newline", "no-newline", 'n');
|
||||
args_parser.add_positional_argument(paths, "Symlink path", "path");
|
||||
args_parser.parse(arguments);
|
||||
|
||||
for (const char* path : paths) {
|
||||
for (auto path : paths) {
|
||||
auto destination = TRY(Core::File::read_link(path));
|
||||
out("{}", destination);
|
||||
if (!no_newline)
|
||||
|
Loading…
Reference in New Issue
Block a user