1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:24:57 +00:00

Utilities: Read positional arguments as Strings not char*s

This is a pretty trivial change so they're all batched together.
This commit is contained in:
Sam Atkins 2022-04-02 16:48:05 +01:00 committed by Andreas Kling
parent 84b67754c0
commit f0aba519c3
18 changed files with 46 additions and 52 deletions

View file

@ -13,7 +13,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments)
{
Vector<char const*> paths;
Vector<String> paths;
char const* opt_algorithm = nullptr;
Core::ArgsParser args_parser;
@ -43,7 +43,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
bool fail = false;
for (auto& path : paths) {
auto filepath = (StringView(path) == "-") ? "/dev/stdin" : path;
auto filepath = (path == "-") ? "/dev/stdin" : path;
auto file = Core::File::construct(filepath);
if (!file->open(Core::OpenMode::ReadOnly)) {
warnln("{}: {}: {}", arguments.strings[0], path, file->error_string());