apio
140910763e
All checks were successful
Build and test / build (push) Successful in 1m56s
Why are command-line utilities stored in "apps"? And why are apps like "editor" or "terminal" top-level directories? Command-line utilities now go in "utils". GUI stuff now goes in "gui". This includes: libui -> gui/libui, wind -> gui/wind, GUI apps -> gui/apps, editor&terminal -> gui/apps... System services go in "system".
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;
|
|
}
|