diff --git a/main.cpp b/main.cpp index eb490f1..2337995 100644 --- a/main.cpp +++ b/main.cpp @@ -51,6 +51,14 @@ int main(int argc, char** argv) { if (done_c && done_sc && done_cpu) { Runtime rt(sc, cpu, c); rt.run(); + } else { + std::cerr << "USAGE: The program takes three files, with their specific flags prepending them. Example:\n\n" + << " schdulEd -cpu classes_per_uc.csv -c classes.csv -sc students_classes.csv\n\n" + << "Where '-cpu' is the flag that specifies a CSV file which contains the list of classes per each UC\n" + << "Where '-c' is the flag that specifies a CSV file which contains the list of classes an their schedules\n" + << "Where '-sc' is the flag that specifies a CSV file which contains the list of students and their association with each class\n" + << std::endl; + std::exit(1); } return 0; diff --git a/src/Runtime.cpp b/src/Runtime.cpp index d7ff3d9..1fcb584 100644 --- a/src/Runtime.cpp +++ b/src/Runtime.cpp @@ -166,10 +166,10 @@ void Runtime::run() { void Runtime::process_args(std::vector args) { if (args[0] == "quit") { - std::string answer; + char answer; std::cout << "Do you wish to save any changes you have made? [y/N]" << std::endl; std::cin >> std::noskipws >> answer; - if (answer == "y") { + if (answer == 'y') { std::cout << "Saving..." << std::endl; this->save_all(); this->students_classes_->write_to_file();