diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/CMakeLists.txt b/Meta/Lagom/Tools/CodeGenerators/LibWeb/CMakeLists.txt index e9963fc06e7..b4ddaabc433 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/CMakeLists.txt +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/CMakeLists.txt @@ -4,7 +4,7 @@ lagom_tool(Generate_CSS_MediaFeatureID_h SOURCES Generate_CSS_MediaFeatureID_h lagom_tool(Generate_CSS_MediaFeatureID_cpp SOURCES Generate_CSS_MediaFeatureID_cpp.cpp LIBS LagomMain) lagom_tool(Generate_CSS_PropertyID_h SOURCES Generate_CSS_PropertyID_h.cpp) lagom_tool(Generate_CSS_PropertyID_cpp SOURCES Generate_CSS_PropertyID_cpp.cpp) -lagom_tool(Generate_CSS_ValueID_h SOURCES Generate_CSS_ValueID_h.cpp) +lagom_tool(Generate_CSS_ValueID_h SOURCES Generate_CSS_ValueID_h.cpp LIBS LagomMain) lagom_tool(Generate_CSS_ValueID_cpp SOURCES Generate_CSS_ValueID_cpp.cpp) add_subdirectory(WrapperGenerator) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_ValueID_h.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_ValueID_h.cpp index 39a3fa6d10e..c8f1afe096e 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_ValueID_h.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/Generate_CSS_ValueID_h.cpp @@ -5,23 +5,18 @@ */ #include "GeneratorUtil.h" -#include -#include #include #include -#include +#include -int main(int argc, char** argv) +ErrorOr serenity_main(Main::Arguments arguments) { - if (argc != 2) { - warnln("usage: {} ", argv[0]); + if (arguments.argc != 2) { + warnln("usage: {} ", arguments.strings[0]); return 1; } - auto file = Core::File::construct(argv[1]); - if (!file->open(Core::OpenMode::ReadOnly)) - return 1; - auto json = JsonValue::from_string(file->read_all()).release_value_but_fixme_should_propagate_errors(); + auto json = TRY(read_entire_file_as_json(arguments.strings[1])); VERIFY(json.is_array()); StringBuilder builder; @@ -58,4 +53,5 @@ const char* string_from_value_id(ValueID); )~~~"); outln("{}", generator.as_string_view()); + return 0; }