Forgive me if this has already been covered but parsing command line options seems to be my second job lately. Information about getopt can be found here.
DUPLICATE :
http://stackoverflow.com/questions/631410/looking-for-a-command-line-argument-parser-for-net