the best way to check if command line argumets are valid
I'm creating little comman line app and I'm using getopt to parse the command line arguments. Now i'm trying to find the best/easiest way to check if the arguments are valid...
what I mean is. My app accepts this: ./d -a -t 2007-07-27 -d "something" what I want to do is that if the user puts for example ./d -a -d "Math exam" -t 2007-07-27 or something else the app won't do anything else than tells that it's wrong and quits. i still want to accept other arguments like ./d -r 002 and ./d -m 002 -t 2007-08-01.
Any ideas?