문제

I'm trying to parse command line options using code generated by gengetopt, and I'm trying to figure out how to parse an extra argument (after all the other options) that has no long or short option.

I'd like to call it like this:

program [options] [input file]

ex: program -a -b -letterc "C:\somefile.txt" or program -a -b -letterc somefile.txt

where the option "letterc" has no arguments.

Does anyone know how to do this using gengetopt?

도움이 되었습니까?

해결책

These should be avaiable in the inputs member of the gengetopt_args_info. There are input_num of them.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top