mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:44:58 +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:
parent
84b67754c0
commit
f0aba519c3
18 changed files with 46 additions and 52 deletions
|
@ -35,7 +35,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
TRY(Core::System::pledge("stdio rpath"));
|
||||
|
||||
Vector<char const*> usernames;
|
||||
Vector<String> usernames;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.set_general_help("Print group memberships for each username or, if no username is specified, for the current process.");
|
||||
|
@ -48,7 +48,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
}
|
||||
|
||||
for (auto username : usernames) {
|
||||
auto result = Core::Account::from_name(username, Core::Account::Read::PasswdOnly);
|
||||
auto result = Core::Account::from_name(username.characters(), Core::Account::Read::PasswdOnly);
|
||||
if (result.is_error()) {
|
||||
warnln("{} '{}'", result.error(), username);
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue