In this response to another question, a little Haskell code sketch was given which uses wrapper functions to factor out some code for doing syntax checking on command line argum
You might want to make use of existing libraries to deal with command line arguments. I believe the de-facto standard right now is cmdargs, but other options exist, such as ReadArgs and console-program.