navid/veins / ce5d2696b2bf5da87c6bb709403e2b5463847e423c6fca2c20d78cd931d0c9a1 / 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;
  }
}