gengetopt: How to parse a string without an option (like a file name)
-
07-07-2021 - |
문제
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.
제휴하지 않습니다 StackOverflow