Can I use getopt to process options in a certain order?
I'm implementing a command line tool, and I need to be able to handle a bunch of options. Some of the options must terminate the program after they're done. For example I have options a, b and c. If a and b terminate after their done, and I give the command ./myprogram -bca [file] Is there a way to give "a" precedence in a situation like this using getopt()? EDIT: I solved this by running a switch on the options and set a flag if an option was selected. Then sent all the flags to a function that looks at the flags in order. There are two main ways to process the options read by getopt() . One