#include #include #include #include #include Result luna_main(int argc, char** argv) { StringView pathname; os::ArgumentParser parser; parser.add_positional_argument(pathname, "path"_sv, true); parser.parse(argc, argv); auto file = TRY(os::File::open_or_create(pathname, os::File::WriteOnly)); char buffer[4096]; while (1) { char* rc = fgets(buffer, sizeof(buffer), stdin); if (rc == 0) break; TRY(file->write(StringView { buffer })); } return 0; }