#include <iostream>
#include <vector>
#include <stdexcept>

using namespace std;

#include "io.h"
#include "restaurant.h"

const string usage = "usage: iotest <input json file>";

int main(int argc, char * argv[]) {
    if (argc != 2) {
        cerr << usage << endl;
        return 1;
    }
    try {
        vector<restaurant> v = parse_file(argv[1]);
        for(auto r: v) {
            cout << r << endl;
        }
    }
    catch(runtime_error e) {
        cerr << e.what() << endl;
    }
    return 0;
}
