c++ - Calling applications with get_opt -
i trying figure out. have not been able call small program following options:
static struct option long_options[] = { {"t", 2, 0, 0 }, {"m", 2, 0, 1 }, {0,0,0,0} }; while (1) { int oi = 0; int c = getopt_long( argc, argv, "", long_options, &oi ); if ( c == -1) break; switch( c ) { case 0: tenant = atoi(optarg); break; case 1: mantle = atoi(optarg); default: return -1; } }
how supposed call program? have tried
./myprogram -t 10
, ./myprogram --t 10
what ""
in getopt_long
mean?
Comments
Post a Comment