navid/veins / c3f1d72b5216075372f3cc035b966b67f9d318f5d092a7b959ce678fd0d1bb8e / xveins/src/main.cpp

main.cpp

← xveins/src · 500 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;
  }
}