diff --git a/test/eofparse/eofparse.cpp b/test/eofparse/eofparse.cpp index b9a768f751..ee28e750f8 100644 --- a/test/eofparse/eofparse.cpp +++ b/test/eofparse/eofparse.cpp @@ -2,6 +2,7 @@ // Copyright 2023 The evmone Authors. // SPDX-License-Identifier: Apache-2.0 +#include #include #include #include @@ -35,10 +36,18 @@ std::optional from_hex_skip_nonalnum(InputIterator begin, InputIter } // namespace -int main() +int main(int argc, char* argv[]) { try { + CLI::App app{"evmone eofparse tool"}; + const auto& initcode_flag = + *app.add_flag("--initcode", "Validate code as initcode containers"); + + app.parse(argc, argv); + const auto container_kind = + initcode_flag ? evmone::ContainerKind::initcode : evmone::ContainerKind::runtime; + int num_errors = 0; for (std::string line; std::getline(std::cin, line);) { @@ -54,7 +63,7 @@ int main() } const auto& eof = *o; - const auto err = evmone::validate_eof(EVMC_PRAGUE, evmone::ContainerKind::runtime, eof); + const auto err = evmone::validate_eof(EVMC_PRAGUE, container_kind, eof); if (err != evmone::EOFValidationError::success) { std::cout << "err: " << evmone::get_error_message(err) << "\n";