23 lines
476 B
C++
23 lines
476 B
C++
|
#include <os/ArgumentParser.h>
|
||
|
#include <os/File.h>
|
||
|
#include <sys/utsname.h>
|
||
|
|
||
|
Result<int> luna_main(int argc, char** argv)
|
||
|
{
|
||
|
os::ArgumentParser parser;
|
||
|
parser.add_description("Print the current machine's architecture name."_sv);
|
||
|
parser.add_system_program_info("arch"_sv);
|
||
|
parser.parse(argc, argv);
|
||
|
|
||
|
struct utsname info;
|
||
|
if (uname(&info) < 0)
|
||
|
{
|
||
|
perror("uname");
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
os::println("%s", info.machine);
|
||
|
|
||
|
return 0;
|
||
|
}
|