2012-04-12 14:14:33 +10:00
|
|
|
#include "../json.hpp"
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <boost/filesystem.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ARG_CMD,
|
|
|
|
ARG_PATH,
|
|
|
|
|
|
|
|
NUM_ARGS
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char ** argv) {
|
|
|
|
if (argc != NUM_ARGS) {
|
|
|
|
std::cerr << "Invalid arguments. "
|
|
|
|
<< argv[ARG_CMD] << " <path> "
|
|
|
|
<< std::endl;
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
2015-02-02 21:22:38 +11:00
|
|
|
json::tree::parse (boost::filesystem::path (argv[ARG_PATH]));
|
|
|
|
} catch (json::tree::error &x) {
|
2012-04-24 18:12:07 +10:00
|
|
|
std::cerr << "Error: " << x.what () << std::endl;
|
2012-04-12 14:14:33 +10:00
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|