parseargs

The parseargs package provides a Haskell command-line argument "parser". You supply a specification of the arguments to your command-line program---parseargs reads the arguments, checks that they meet your spec, and then fills in a data structure that captures the relevant data. See the Haddock for details.