error: removed some unneeded error handling

This commit is contained in:
Kaley, Fischer 2024-01-19 15:57:26 +01:00
parent 9427005a01
commit f71452dac5

View file

@ -97,9 +97,9 @@ int main(int argc, char* argv[]) {
namesList += name;
}
string rname = config->get_table("runner")->get_as<string>("rname").value_or("dashboard:");
string rname = config->get_table("runner")->get_as<string>("rname").value_or("");
string rtheme = config->get_table("runner")->get_as<string>("rtheme").value_or("");
string rcommand = config->get_table("runner")->get_as<string>("rcommand").value_or("rofi -dmenu -p");
string rcommand = config->get_table("runner")->get_as<string>("rcommand").value_or("rofi -dmenu");
string rofiCommand = "printf '" + namesList + "' | " + rcommand + " '" + rname + " ' " + rtheme;
FILE *rofiProcess = popen(rofiCommand.c_str(), "r");
@ -172,15 +172,8 @@ int main(int argc, char* argv[]) {
bconfig = argv[2];
} else {
while (!(filesystem::exists(bconfigfile) && filesystem::is_regular_file(bconfigfile))) {
cout << "Invalid config file: " << bconfigfile << endl;
cout << "Please enter a valid config: ";
cin >> bconfigfile;
// No need to redeclare bconfigfile here; it will update the outer variable
bconfig = bconfigfile.c_str();
}
cerr << invalidconfig << bconfigfile << endl;
return 1;
}
// executable