mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-06 02:33:44 -04:00
added some error handling
This commit is contained in:
parent
91b45e92cc
commit
5a3b28356b
1 changed files with 18 additions and 8 deletions
|
|
@ -357,11 +357,16 @@ GMainWindow::GMainWindow(Core::System& system_)
|
|||
for (; i < args.size(); i++){
|
||||
if (args[i] == QStringLiteral("-o") || args[i] == QStringLiteral("--output")){
|
||||
i++;
|
||||
QFileInfo outputPath(args[i]);
|
||||
if (outputPath.isDir()){
|
||||
cli_out_path = args[i];
|
||||
if (i < args.size()){
|
||||
QFileInfo outputPath(args[i]);
|
||||
if (outputPath.isDir()){
|
||||
cli_out_path = args[i];
|
||||
} else {
|
||||
QTextStream(stderr) << "Error: " << args[i] << " is not a directory!\n";
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
QTextStream(stderr) << "Error: " << args[i] << " is not a directory!\n";
|
||||
QTextStream(stderr) << "Error: No directory specified";
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
|
|
@ -393,11 +398,16 @@ GMainWindow::GMainWindow(Core::System& system_)
|
|||
for (; i < args.size(); i++){
|
||||
if (args[i] == QStringLiteral("-o") || args[i] == QStringLiteral("--output")){
|
||||
i++;
|
||||
QFileInfo outputPath(args[i]);
|
||||
if (outputPath.isDir()){
|
||||
cli_out_path = args[i];
|
||||
if (i < args.size()){
|
||||
QFileInfo outputPath(args[i]);
|
||||
if (outputPath.isDir()){
|
||||
cli_out_path = args[i];
|
||||
} else {
|
||||
QTextStream(stderr) << "Error: " << args[i] << " is not a directory!\n";
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
QTextStream(stderr) << "Error: " << args[i] << " is not a directory!\n";
|
||||
QTextStream(stderr) << "Error: No directory specified";
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue