navid/veins / 5c47896115dedf2087f6e19487b5b7faf53c7cde0d51c6702c16f7cfc30a1b97 / xveins/src/main.cpp

main.cpp

← xveins/src · 538 bytes · raw · download

#include "cli.h"

#include <exception>
#include <iostream>
#include <string>
#include <vector>

int main(int argc, char** argv) {
    std::vector<std::string> args;
    args.reserve(static_cast<std::size_t>(argc));
    for (int i = 0; i < argc; ++i)
        args.emplace_back(argv[i]);
    try {
        return vn::cli_run(args);
    } catch (const std::exception& e) {
        std::cout << "error: " << e.what() << "\n";
        return 1;
    } catch (...) {
        std::cout << "error: unexpected failure\n";
        return 1;
    }
}