Hi all,
I am using getops to get the arguments passed by the command line.
However, I need to specify some rules regarding the parameter sent.
For eg:
I have script called MyScript which accept parameter d, I, E, r, u
so the usage should be like this:
MyScript [-d N] [-I] [-E] [-r] [-u string]
So far, I finished that part.
But, what I want to do now is:
Suppose if user specify parameter d, it should not accept parameter I and E
If user want to use parameter r and u, it should be accompanied by parameter d , I, or E
So,
MyScript -d5 -I -> InCorrect (should return error)
MyScript -d5 -> Correct
MyScript -r -> InCorrect
MyScript -r -I -> Correct
Could anyone help me..
Thx in advance..