8 static int timeout
= 3;
10 static struct getargs args
[] = {
11 { "help", 'h', arg_flag
, &help_flag
, NULL
, NULL
},
12 { "timeout", 't', arg_integer
, &timeout
, NULL
, NULL
}
15 static int nargs
= sizeof(args
) / sizeof(args
[0]);
18 handle_timeout(void *data
)
23 return -1; /* kill it */
24 return -2; /* stop waiting for it */
30 arg_printusage(args
, nargs
, NULL
, "command");
36 main(int argc
, char **argv
)
42 if (getarg(args
, nargs
, argc
, argv
, &optidx
))
54 return simple_execvp_timed(argv
[0], argv
, handle_timeout
, NULL
,