}
}
+struct ParseError
+{
+ string err;
+ ParseError(const string& msg) : err(msg) { } ;
+};
// minimal arg reading function, not very robust to errors
char
{
cout << "Error: \'" << an_arg;
cout << "\' is not a valid analysis mode for -a argument" << endl;
- run_mode = 'e';
+ throw ParseError("not valid -a argument");
}
*a_file_path = * ++argv;
i++;
{
cout << "Error: \'" << an_arg;
cout << "\' is not a valid run mode for -m argument" << endl;
- run_mode = 'e';
+ throw ParseError("bad argument -m");
}
}