demo ncurses: + opt nb_loops
This commit is contained in:
parent
790e06c4cc
commit
ace7312470
@ -117,15 +117,18 @@ 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 '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:
|
default:
|
||||||
fprintf(stderr, "%s : uh ?", argv[0]);
|
fprintf(stderr, "%s : uh ?", argv[0]);
|
||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user