diff --git a/simple-get-opt.cabal b/simple-get-opt.cabal
--- a/simple-get-opt.cabal
+++ b/simple-get-opt.cabal
@@ -1,5 +1,5 @@
 name:                simple-get-opt
-version:             0.1.0.0
+version:             0.2.0
 synopsis:            A simple library for processing command-line options.
 description:
   A simple library for processing command-line options.
@@ -17,7 +17,7 @@
 library
   hs-source-dirs:      src
   exposed-modules:     SimpleGetOpt
-  build-depends:       base < 10
+  build-depends:       base < 5
   default-language:    Haskell2010
 
 source-repository head
diff --git a/src/SimpleGetOpt.hs b/src/SimpleGetOpt.hs
--- a/src/SimpleGetOpt.hs
+++ b/src/SimpleGetOpt.hs
@@ -48,10 +48,12 @@
 module SimpleGetOpt
   ( -- * Basic functionality
     getOpts
+  , getOptsX
   , OptSpec(..)
   , OptDescr(..)
   , OptSetter
   , ArgDescr(..)
+  , GetOptException(..)
 
   -- * Information and error reporting.
   , dumpUsage
@@ -65,6 +67,7 @@
 import System.Environment(getArgs)
 
 import Control.Monad(unless)
+import Control.Exception(Exception,throwIO,catch)
 
 
 
@@ -140,18 +143,28 @@
 
 -- | Get the command-line options and process them according to the given spec.
 -- The options will be permuted to get flags.
-getOpts :: OptSpec a -> IO a
-getOpts os =
+-- Throws a 'GetOptException' if some problems are found.
+getOptsX :: OptSpec a -> IO a
+getOptsX os =
   do as <- getArgs
      let (funs,files,errs) = GetOpt.getOpt GetOpt.Permute (opts os) as
-     unless (null errs) $ reportUsageError os errs
+     unless (null errs) $ throwIO (GetOptException errs)
      let (a, errs1) = foldl addOpt (progDefaults os,[]) funs
-     unless (null errs1) $ reportUsageError os errs1
+     unless (null errs1) $ throwIO (GetOptException errs1)
      let (b, errs2) = foldl (addFile (progParams os)) (a,[]) files
-     unless (null errs2) $ reportUsageError os errs2
+     unless (null errs2) $ throwIO (GetOptException errs2)
      return b
 
--- | Print the given messages on 'stderr' and show the program's usage info.
+
+-- | Get the command-line options and process them according to the given spec.
+-- The options will be permuted to get flags.
+-- On failure, print an error message on standard error and exit.
+getOpts :: OptSpec a -> IO a
+getOpts os =
+  getOptsX os `catch` \(GetOptException errs) -> reportUsageError os errs
+
+-- | Print the given messages on 'stderr' and show the program's usage info,
+-- then exit.
 reportUsageError :: OptSpec a -> [String] -> IO b
 reportUsageError os es =
   do hPutStrLn stderr "Invalid command line options:"
@@ -173,6 +186,10 @@
              ps -> "Parameters:\n" ++ ps ++ "\n"
 
   ppParam (x,y) = "  " ++ x ++ "    " ++ y ++ "\n"
+
+data GetOptException = GetOptException [String] deriving Show
+
+instance Exception GetOptException
 
 
 
