diff --git a/driver/Main.hs b/driver/Main.hs
--- a/driver/Main.hs
+++ b/driver/Main.hs
@@ -1,9 +1,21 @@
+{-# LANGUAGE LambdaCase #-}
 module Main (main) where
 
 import           System.Environment
 
 import qualified Hpack
-import qualified Hpack.Config as Hpack
+import           Hpack.Config
+import           Control.Exception
 
 main :: IO ()
-main = getArgs >>= Hpack.getOptions Hpack.packageConfig >>= mapM_ (uncurry Hpack.hpack)
+main = getArgs >>= \ case
+  ["list"] -> exposedModules packageConfig >>= mapM_ (putStrLn . unModule)
+  args -> Hpack.getOptions packageConfig args >>= mapM_ (uncurry Hpack.hpack)
+
+exposedModules :: FilePath -> IO [Module]
+exposedModules file = readPackageConfig defaultDecodeOptions {decodeOptionsTarget = file} >>= \ case
+  Left err -> throwIO $ ErrorCall err
+  Right result -> return $ modules result
+  where
+    modules :: DecodeResult -> [Module]
+    modules = maybe [] (libraryExposedModules . sectionData) . packageLibrary . decodeResultPackage
diff --git a/hpack.cabal b/hpack.cabal
--- a/hpack.cabal
+++ b/hpack.cabal
@@ -1,11 +1,11 @@
 cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.35.3.
+-- This file has been generated from package.yaml by hpack version 0.35.4.
 --
 -- see: https://github.com/sol/hpack
 
 name:           hpack
-version:        0.35.4
+version:        0.35.5
 synopsis:       A modern format for Haskell packages
 description:    See README at <https://github.com/sol/hpack#readme>
 category:       Development
diff --git a/resources/test/hpack.cabal b/resources/test/hpack.cabal
--- a/resources/test/hpack.cabal
+++ b/resources/test/hpack.cabal
@@ -1,11 +1,11 @@
 cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.35.3.
+-- This file has been generated from package.yaml by hpack version 0.35.4.
 --
 -- see: https://github.com/sol/hpack
 
 name:           hpack
-version:        0.35.4
+version:        0.35.5
 synopsis:       A modern format for Haskell packages
 description:    See README at <https://github.com/sol/hpack#readme>
 category:       Development
