mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:04:59 +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
|
@ -15,7 +15,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
{
|
||||
TRY(Core::System::pledge("stdio cpath"));
|
||||
|
||||
Vector<char const*> paths;
|
||||
Vector<String> paths;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_positional_argument(paths, "Directories to remove", "paths");
|
||||
|
@ -23,7 +23,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
int status = 0;
|
||||
for (auto path : paths) {
|
||||
int rc = rmdir(path);
|
||||
int rc = rmdir(path.characters());
|
||||
if (rc < 0) {
|
||||
perror("rmdir");
|
||||
status = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue