Browse Source

demo ncurses: + opt nb_loops

master
tth 3 years ago
parent
commit
ace7312470
1 changed files with 9 additions and 6 deletions
  1. +9
    -6
      viz/curses/t.c

+ 9
- 6
viz/curses/t.c 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;
}
/*


Loading…
Cancel
Save