Skip to content

Commit

Permalink
Add interactive mode to select filename
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel committed Jan 24, 2017
1 parent a3eb94b commit 8f610cf
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions OMPlot/OMPlotGUI/main.cpp
Expand Up @@ -192,11 +192,21 @@ int main(int argc, char *argv[])
{
fprintf(stdout, "Info: This directory contains following result files:\n");
for(int i=0;i<count;i++)
fprintf(stderr, " * '%s'\n", resultFiles.at(i).toUtf8().constData());
fprintf(stdout, " %d. %s\n", i+1, resultFiles.at(i).toUtf8().constData());
fprintf(stdout, " 0. another file\n");

fprintf(stderr, "Error: No filename specified.\n");
printUsage(true);
return 1;
int choise;
fprintf(stdout, " Make your choice: ");
scanf("%d", &choise);
if(choise > 0 && choise <= count)
filename = resultFiles.at(choise-1);
else
{
if(choise != 0)
fprintf(stderr, "Error: Invalid index specified.\n");
printUsage(true);
return 1;
}
}
}

Expand Down

0 comments on commit 8f610cf

Please sign in to comment.