navid/veins / 6169bc0f55b5c2ca7a3d19b3405cfaa6fa103a02cf0867e5daa279487e292194 / xveins/src/main.cpp

main.cpp

← xveins/src · 542 bytes · raw · download

#include "cli/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;
    }
}