Luna/apps/mount.cpp
apio 2f08e0f5b0
All checks were successful
continuous-integration/drone/push Build is passing
libos: Make long value arguments use '=' and make value arguments' values always required
2023-06-17 20:58:54 +02:00

25 lines
617 B
C++

#include <os/ArgumentParser.h>
#include <stdio.h>
#include <sys/mount.h>
Result<int> luna_main(int argc, char** argv)
{
StringView target;
StringView fstype { "auto" };
os::ArgumentParser parser;
parser.add_description("Mount a file system.");
parser.add_system_program_info("mount"_sv);
parser.add_positional_argument(target, "mountpoint"_sv, true);
parser.add_value_argument(fstype, 't', "type"_sv, "the file system type to use");
parser.parse(argc, argv);
if (mount(target.chars(), fstype.chars()) < 0)
{
perror("mount");
return 1;
}
return 0;
}