Files
tai/taicpp/tests/cli_main.cpp
T

15 lines
660 B
C++

// Minimal detz entry point over the cli module only, so tools/parity_diff.py can run the
// parse-only cases (tests/diff/cases/cli_generated.json) without the full binary.
// It mirrors the first lines of main.cpp (error, version) and then Command::run.
#include <cstdio>
#include <string>
#include "../src/cli/cli.h"
#include "version.hpp"
int main(int argc, char** argv) {
detz::cli::Parser p;
auto cmd = p.parse(argc, argv);
if (!cmd.opts.error.empty()) { std::fputs((cmd.opts.error + "\n").c_str(), stderr); return 2; }
if (cmd.opts.version) { std::puts(("tai " + std::string(detz::kVersion)).c_str()); return 0; }
return cmd.run();
}