Userland: Allow passing a specific HTML file to the "ht" test program

This commit is contained in:
Andreas Kling 2020-05-23 18:42:33 +02:00
parent f4985ca113
commit ede44853d1
Notes: sideshowbarker 2024-07-19 06:12:23 +09:00

View file

@ -29,10 +29,14 @@
#include <AK/ByteBuffer.h>
#include <AK/LogStream.h>
int main(int, char**)
int main(int argc, char** argv)
{
// This is a temporary test program to aid with bringing up the new HTML parser. :^)
auto file_or_error = Core::File::open("/home/anon/www/simple.html", Core::File::ReadOnly);
const char* input_path = "/home/anon/www/simple.html";
if (argc > 1)
input_path = argv[1];
auto file_or_error = Core::File::open(input_path, Core::File::ReadOnly);
if (file_or_error.is_error())
return 1;
auto contents = file_or_error.value()->read_all();