I think this is very specific to your application.
First, how do you measure the success of your application? Is this a result code? Is this something printed on the console?
For question 2, it depends on how you parse these flags in your application. In most cases, the order of the flags is not important, but there are times when it is. Hope you don't need to check for flag permutations because this will add a lot of tests to test.
In general, you should analyze what the effect of each flag is. It is possible that the flag does not interfere with others, and then you just need to check it. This also applies to flags that are intended to be used separately (for example, -help or -version). You also need to analyze what values ββyou should check for each flag. Usually you want to try every possible valid value and every kind of possible invalid value.
I think a simple simple bash script can be written to run tests or any scripting language such as Python. Using nested loops, you can try, for each flag, to use values, including tests for invalid values ββand the case when the flag is not set. I will create a multi-dimensional matrix of results that needs to be analyzed to see if the results are as expected.
source share