demo ncurses: + opt nb_loops

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

View File

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