about summary refs log tree commit diff stats
path: root/generator/main.cpp
blob: 5a3d2ddba885cf9baf243fdbceb9ab788b422025 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <exception>
#include "generator.h"

void printUsage()
{
  std::cout << "usage: generator input output" << std::endl;
  std::cout << "input  :: path to an AcousticBrainz data directory" << std::endl;
  std::cout << "output :: datafile output path" << std::endl;
}

int main(int argc, char** argv)
{
  if (argc == 3)
  {
    try
    {
      cadence::generator::generator app(argv[1], argv[2]);
      
      try
      {
        app.run();
      } catch (const std::exception& e)
      {
        std::cout << e.what() << std::endl;
      }
    } catch (const std::exception& e)
    {
      std::cout << e.what() << std::endl;
      printUsage();
    }
  } else {
    std::cout << "cadence datafile generator" << std::endl;
    printUsage();
  }
}