I don't believe what you're asking for is possible.
This is probably a good thing: what should your program do if invoked as ./my_prog -a -b
where -b
is another option it's supposed to take? It's not obvious whether it should use -b
as the optional filename following -a
, or assume the filename wasn't given and treat it as an option.
I would therefore suggest reconsidering whether the behaviour you ask for is actually a good idea.