Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DuarteSAssuncao committed Nov 2, 2023
1 parent 5abee22 commit 17357c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ void Runtime::run() {

void Runtime::process_args(std::vector<std::string> 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();
Expand Down

0 comments on commit 17357c0

Please sign in to comment.