From ede44853d14c222cf7e6bd808051a1a1711b7f6e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 23 May 2020 18:42:33 +0200 Subject: [PATCH] Userland: Allow passing a specific HTML file to the "ht" test program --- Userland/ht.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Userland/ht.cpp b/Userland/ht.cpp index 0a79c8366a..02c01913ce 100644 --- a/Userland/ht.cpp +++ b/Userland/ht.cpp @@ -29,10 +29,14 @@ #include #include -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();