demo ncurses: + opt nb_loops

This commit is contained in:
tth 2019-01-27 11:01:33 +01:00
parent 790e06c4cc
commit ace7312470

View File

@ -117,15 +117,18 @@ int main (int argc, char *argv[])
{
int opt;
int demonum = 0;
int nb_loops = 200;
/* set some default values */
verbosity = 0;
while ((opt = getopt(argc, argv, "vy:")) != -1) {
while ((opt = getopt(argc, argv, "n:vy:")) != -1) {
switch (opt) {
case 'v': verbosity++; break;
case 'n': nb_loops = atoi(optarg); break;
case 'y': demonum = atoi(optarg); break;
case 'v': verbosity++; break;
case 'y': demonum = atoi(optarg); break;
default:
fprintf(stderr, "%s : uh ?", argv[0]);
@ -143,9 +146,9 @@ keypad(stdscr, TRUE); /* acces aux touches 'curseur' */
fond_ecran(" Demonstrator ");
switch (demonum) {
case 0: demo_vumetres(666, 0); break;
case 1: demo_waterfall(666, 0); break;
case 2: demo_7segments(4567, 0); break;
case 0: demo_vumetres(nb_loops, 0); break;
case 1: demo_waterfall(nb_loops, 0); break;
case 2: demo_7segments(nb_loops, 0); break;
}
/*