Nisan Bahar
Nisan Bahar

Reputation: 73

GenGetOpt - Allow only "--option" and not "-option"

I am having troubles to define an option to only accept "--" and not "-" version.

for example:

option "test" - "a test option" string typestr="[value]" optional multiple

When running my program, it is allowed to run both:

run -test asd

and

run --test asd

I wish -test to not be allowed and fail the software. I read the gengetopt manuals but didn't seem to find anything related to that.

Thanks!

Upvotes: 0

Views: 127

Answers (1)

MSalters
MSalters

Reputation: 179887

The easiest solution might be to just check argv[] yourself before passing it over to the generated cmdline_parser().

Upvotes: 1

Related Questions