Luna/apps/rm.cpp

20 lines
344 B
C++
Raw Normal View History

2023-04-12 16:11:43 +00:00
#include <os/ArgumentParser.h>
#include <stdio.h>
2023-04-13 15:04:59 +00:00
Result<int> luna_main(int argc, char** argv)
2023-04-12 16:11:43 +00:00
{
StringView path;
os::ArgumentParser parser;
parser.add_positional_argument(path, "path"_sv, true);
parser.parse(argc, argv);
if (remove(path.chars()) < 0)
{
perror("rm");
return 1;
}
2023-04-13 15:04:59 +00:00
return 0;
2023-04-12 16:11:43 +00:00
}