diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-01-09 14:01:51 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-01-09 14:01:51 -0500 |
commit | 46b7119fab32b05923dbf9cda7cd6ce62f572846 (patch) | |
tree | 31ac6c281869085e5dbc6b210886c554d4c52cad /generator/main.cpp | |
download | cadence-46b7119fab32b05923dbf9cda7cd6ce62f572846.tar.gz cadence-46b7119fab32b05923dbf9cda7cd6ce62f572846.tar.bz2 cadence-46b7119fab32b05923dbf9cda7cd6ce62f572846.zip |
Initial commit
Diffstat (limited to 'generator/main.cpp')
-rw-r--r-- | generator/main.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/generator/main.cpp b/generator/main.cpp new file mode 100644 index 0000000..5a3d2dd --- /dev/null +++ b/generator/main.cpp | |||
@@ -0,0 +1,36 @@ | |||
1 | #include <iostream> | ||
2 | #include <exception> | ||
3 | #include "generator.h" | ||
4 | |||
5 | void printUsage() | ||
6 | { | ||
7 | std::cout << "usage: generator input output" << std::endl; | ||
8 | std::cout << "input :: path to an AcousticBrainz data directory" << std::endl; | ||
9 | std::cout << "output :: datafile output path" << std::endl; | ||
10 | } | ||
11 | |||
12 | int main(int argc, char** argv) | ||
13 | { | ||
14 | if (argc == 3) | ||
15 | { | ||
16 | try | ||
17 | { | ||
18 | cadence::generator::generator app(argv[1], argv[2]); | ||
19 | |||
20 | try | ||
21 | { | ||
22 | app.run(); | ||
23 | } catch (const std::exception& e) | ||
24 | { | ||
25 | std::cout << e.what() << std::endl; | ||
26 | } | ||
27 | } catch (const std::exception& e) | ||
28 | { | ||
29 | std::cout << e.what() << std::endl; | ||
30 | printUsage(); | ||
31 | } | ||
32 | } else { | ||
33 | std::cout << "cadence datafile generator" << std::endl; | ||
34 | printUsage(); | ||
35 | } | ||
36 | } | ||