@@ -60,9 +60,11 @@ const struct argp_option options[] = {
6060 { "join-pid" , -5 , "PID" , 0 , "join a namespace using a PID" },
6161 { "join-ct" , -3 , "N" , 0 , "number of join peers (implies --join)" },
6262 { "join-tag" , -4 , "TAG" , 0 , "label for peer group (implies --join)" },
63+ { "test" , -17 , "TEST" , 0 , "do test TEST" },
6364 { "mount" , 'm' , "DIR" , 0 , "SquashFS mount point" },
6465 { "no-passwd" , -9 , 0 , 0 , "don't bind-mount /etc/{passwd,group}" },
6566 { "private-tmp" , 't' , 0 , 0 , "use container-private /tmp" },
67+ { "quiet" , 'q' , 0 , 0 , "print less output (can be repeated)" },
6668#ifdef HAVE_SECCOMP
6769 { "seccomp" , -14 , 0 , 0 ,
6870 "fake success for some syscalls with seccomp(2)" },
@@ -476,13 +478,21 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
476478 args -> seccomp_p = true;
477479 break ;
478480#endif
481+ case -15 : // --set-env0
482+ parse_set_env (args , arg , '\0' );
483+ break ;
479484 case -16 : // --warnings
480485 for (int i = 1 ; i <= parse_int (arg , false, "--warnings" ); i ++ )
481486 WARNING ("this is warning %d!" , i );
482487 exit (0 );
483488 break ;
484- case -15 : // --set-env0
485- parse_set_env (args , arg , '\0' );
489+ case -17 : // --test
490+ if (!strcmp (arg , "log" ))
491+ test_logging (false);
492+ else if (!strcmp (arg , "log-fail" ))
493+ test_logging (true);
494+ else
495+ FATAL ("invalid --test argument: %s; see source code" , arg );
486496 break ;
487497 case 'b' : { // --bind
488498 char * src , * dst ;
@@ -525,6 +535,11 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
525535 if (!path_exists (arg , NULL , false))
526536 WARNING ("storage directory not found: %s" , arg );
527537 break ;
538+ case 'q' : // --quiet
539+ Te (verbose <= 0 , "--quiet incompatible with --verbose" );
540+ verbose -- ;
541+ Te (verbose >= -3 , "--quiet can be specified at most thrice" );
542+ break ;
528543 case 't' : // --private-tmp
529544 args -> c .private_tmp = true;
530545 break ;
@@ -538,6 +553,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
538553 exit (EXIT_SUCCESS );
539554 break ;
540555 case 'v' : // --verbose
556+ Te (verbose >= 0 , "--verbose incompatible with --quiet" );
541557 verbose ++ ;
542558 Te (verbose <= 3 , "--verbose can be specified at most thrice" );
543559 break ;
0 commit comments