school/cs142/smcquay/lab09/main.cc

30 lines
610 B
C++
Raw Normal View History

2016-04-06 20:45:34 -07:00
#include <iostream>
#include <string>
#include <vector>
#include <stdexcept>
using namespace std;
#include "person.h"
#include "util.h"
const string usage = "usage: app <input file> <output file>";
int main(int argc, char * argv []) {
if(argc != 3) {
cerr << usage << endl;
return 1;
}
string input_filename(argv[1]);
string output_filename(argv[2]);
try {
vector<person> people = parse_file(input_filename);
save_file(output_filename, people);
}
catch(runtime_error e) {
cerr << e.what() << endl;
return 1;
}
return 0;
}