diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -70,6 +70,9 @@
 
 If an additional source file is given, then the cabal file is searched for a fitting section.
 
+If no cabal file nor a source file is given, then starting at the current directory a
+cabal file is searched upwards the directory tree.
+
 Sections
 ========
 
@@ -79,6 +82,7 @@
 * `--executable=name`
 * `--testsuite=name`
 * `--benchmark=name`
+* `--allsections`
 
 You can use multiple of these options at once and even specify multiple
 e.g. executables at once: `--executable=exe1 --executable=exe2 ...`.
@@ -87,7 +91,8 @@
 ======
 
 By default all fields of a section are printed out. You can constrain the
-output by the option: `--only=name`. This option can be specified multiple times.
+output by the options: `--only=name` or `--ignore=name`. These options can
+be specified multiple times.
 
 The allowed names are the field names from the cabal file, just the hyphen
 replaced by an underscore e.g.: `hs-source-dirs` -> `hs_source_dirs`.
@@ -105,6 +110,7 @@
 * `ld_options`
 * `include_dirs`
 * `includes`
+* `build_depends`
 
 There are further some special fields:
 * `package_db`
@@ -115,7 +121,7 @@
 
 It's not quite true, that all fields are printed out if not constrained, that's
 only the case for the `pure` formatting option. For the other formatting options
-currently the fields `c_sources`, `extra_libraries` and `ld_options` are ignored
+currently the fields `c_sources` and `ld_options` are ignored
 and additionally the `ghc` formatting option ignores the `hdevtools_socket` field.
 
 Flags
diff --git a/cabal-cargs.cabal b/cabal-cargs.cabal
--- a/cabal-cargs.cabal
+++ b/cabal-cargs.cabal
@@ -1,5 +1,5 @@
 name: cabal-cargs
-version: 0.3.1
+version: 0.4
 cabal-version: >=1.9.2
 build-type: Simple
 license: BSD3
@@ -40,7 +40,7 @@
                    text >=1.1.0.1 && <1.2, system-filepath >=0.4.9 && <0.5,
                    system-fileio >=0.3.12 && <0.4, unordered-containers >=0.2.3.3 && <0.3,
                    Cabal >=1.18.0 && <1.19
-    exposed-modules: CabalCargs.Args CabalCargs.Field CabalCargs.Fields
+    exposed-modules: CabalCargs.Args CabalCargs.Fields
                      CabalCargs.Formatting CabalCargs.Format CabalCargs.Spec
                      CabalCargs.Sections CabalCargs.CompilerArgs CabalCargs.BuildInfo
                      CabalCargs.CondVars
diff --git a/lib/CabalCargs/Args.hs b/lib/CabalCargs/Args.hs
--- a/lib/CabalCargs/Args.hs
+++ b/lib/CabalCargs/Args.hs
@@ -5,8 +5,8 @@
    , get
    ) where
 
-import System.Console.CmdArgs
-import CabalCargs.Field (Field)
+import System.Console.CmdArgs hiding (ignore)
+import CabalCargs.Fields (Field)
 import CabalCargs.Formatting (Formatting)
  
 #ifdef CABAL
@@ -17,38 +17,42 @@
 
 -- | The command line arguments of the cabal-cargs command.
 data Args = Args
-   { library    :: Bool
-   , executable :: [String]
-   , testSuite  :: [String]
-   , benchmark  :: [String]
-   , only       :: [Field]
-   , format     :: Formatting
-   , sourceFile :: Maybe FilePath
-   , cabalFile  :: Maybe FilePath
-   , enable     :: [String]
-   , disable    :: [String]
-   , os         :: Maybe String
-   , arch       :: Maybe String
-   , relative   :: Bool
+   { library     :: Bool
+   , executable  :: [String]
+   , testSuite   :: [String]
+   , benchmark   :: [String]
+   , allSections :: Bool
+   , only        :: [Field]
+   , ignore      :: [Field]
+   , format      :: Formatting
+   , sourceFile  :: Maybe FilePath
+   , cabalFile   :: Maybe FilePath
+   , enable      :: [String]
+   , disable     :: [String]
+   , os          :: Maybe String
+   , arch        :: Maybe String
+   , relative    :: Bool
    }
    deriving (Data, Typeable, Show, Eq)
 
 
 get :: IO Args
 get = cmdArgs $ Args
-   { library    = def &= help "Only the compiler args of the library section are printed out."
-   , executable = def &= typ "NAME" &= help "Only the compiler args of the executable section are printed out."
-   , testSuite  = def &= typ "NAME" &= help "Only the compiler args of the test suite section are printed out."
-   , benchmark  = def &= typ "NAME" &= help "Only the compiler args of the benchmark section are printed out."
-   , only       = def &= typ "FIELD" &= help "Only the specified compiler args are printed out, otherwise all args are printed out. The field name equals the ones in the cabal file, just the '-' replaced by a '_' e.g.: hs_source_dirs, ghc_options, cpp_options ..."
-   , format     = def &= typ "FORMAT" &= help "How the print out should be formated: ghc, hdevtools, pure."
-   , sourceFile = def &= typ "FILE" &= help "If given, then the cabal file is searched for a matching section. If multiple sections match, then all sections are used."
-   , cabalFile  = def &= typ "FILE" &= help "If not given, then a cabal file is searched upwards the directory tree."
-   , enable     = def &= explicit &= typ "FLAGNAME" &= name "enable" &= name "E" &= help "Enable a flag defined in the cabal file."
-   , disable    = def &= explicit &= typ "FLAGNAME" &= name "disable" &= name "D" &= help "Disable a flag defined in the cabal file."
-   , os         = def &= explicit &= typ "NAME" &= name "os" &= help "Set the used OS. See 'Distribution.System.OS' in the cabal library for valid values."
-   , arch       = def &= explicit &= typ "NAME" &= name "arch" &= help "Set the used Arch. See 'Distribution.System.Arch' in the cabal library for valid values."
-   , relative   = def &= help "If all returned paths should be relative to the directory of the cabal file, otherwise the paths are absolute. This option is mostly only used for the normalization of the output for the test cases."
+   { library     = def &= help "Only the compiler args of the library section are printed out."
+   , executable  = def &= typ "NAME" &= help "Only the compiler args of the executable section are printed out."
+   , testSuite   = def &= typ "NAME" &= help "Only the compiler args of the test suite section are printed out."
+   , benchmark   = def &= typ "NAME" &= help "Only the compiler args of the benchmark section are printed out."
+   , allSections = def &= help "Compiler args of all sections are printed out."
+   , only        = def &= typ "FIELD" &= help "Only the specified compiler args are printed out, otherwise all args are printed out. The field name equals the ones in the cabal file, just the '-' replaced by a '_' e.g.: hs_source_dirs, ghc_options, cpp_options ..."
+   , ignore      = def &= typ "FIELD" &= help "These compiler args are ignored, not printed out."
+   , format      = def &= typ "FORMAT" &= help "How the print out should be formated: ghc, hdevtools, pure."
+   , sourceFile  = def &= typ "FILE" &= help "If given, then the cabal file is searched for a matching section. If multiple sections match, then all sections are used."
+   , cabalFile   = def &= typ "FILE" &= help "If not given, then a cabal file is searched upwards the directory tree."
+   , enable      = def &= explicit &= typ "FLAGNAME" &= name "enable" &= name "E" &= help "Enable a flag defined in the cabal file."
+   , disable     = def &= explicit &= typ "FLAGNAME" &= name "disable" &= name "D" &= help "Disable a flag defined in the cabal file."
+   , os          = def &= explicit &= typ "NAME" &= name "os" &= help "Set the used OS. See 'Distribution.System.OS' in the cabal library for valid values."
+   , arch        = def &= explicit &= typ "NAME" &= name "arch" &= help "Set the used Arch. See 'Distribution.System.Arch' in the cabal library for valid values."
+   , relative    = def &= help "If all returned paths should be relative to the directory of the cabal file, otherwise the paths are absolute. This option is mostly only used for the normalization of the output for the test cases."
    }
    &= program "cabal-cargs"
    &= summary ""
diff --git a/lib/CabalCargs/BuildInfo.hs b/lib/CabalCargs/BuildInfo.hs
--- a/lib/CabalCargs/BuildInfo.hs
+++ b/lib/CabalCargs/BuildInfo.hs
@@ -1,7 +1,8 @@
 {-# LANGUAGE TemplateHaskell, Rank2Types, PatternGuards #-}
 
 module CabalCargs.BuildInfo
-   ( buildInfosOfLib
+   ( BuildInfo(..)
+   , buildInfosOfLib
    , buildInfosOfExe
    , buildInfosOfTest
    , buildInfosOfBenchmark
@@ -10,31 +11,44 @@
    , field
    ) where
 
-import Distribution.PackageDescription
+import qualified Distribution.PackageDescription as PD
+import Distribution.PackageDescription (GenericPackageDescription(..), CondTree(..), ConfVar)
 import Distribution.Compiler
-import Distribution.Package (Dependency)
+import Distribution.Package (Dependency(..), PackageName(..))
+import Distribution.Version (anyVersion)
 import Language.Haskell.Extension
 import Control.Lens
 import Data.List (find)
 import qualified CabalCargs.Sections as S
-import qualified CabalCargs.Field as F
+import qualified CabalCargs.Fields as F
 import qualified CabalCargs.CondVars as CV
 
 
-makeLensesFor [ ("hsSourceDirs"     , "hsSourceDirsL")
-              , ("options"          , "optionsL")
-              , ("defaultLanguage"  , "defaultLanguageL")
-              , ("cppOptions"       , "cppOptionsL")
-              , ("cSources"         , "cSourcesL")
-              , ("ccOptions"        , "ccOptionsL")
-              , ("extraLibDirs"     , "extraLibDirsL")
-              , ("extraLibs"        , "extraLibsL")
-              , ("ldOptions"        , "ldOptionsL")
-              , ("includeDirs"      , "includeDirsL")
-              , ("includes"         , "includesL")
+data BuildInfo = BuildInfo
+   { buildInfo    :: PD.BuildInfo
+   , buildDepends :: [Dependency]
+   } deriving (Show, Eq)
+
+
+makeLensesFor [ ("buildInfo"   , "buildInfoL")
+              , ("buildDepends", "buildDependsL")
               ] ''BuildInfo
 
 
+makeLensesFor [ ("hsSourceDirs"      , "hsSourceDirsL")
+              , ("options"           , "optionsL")
+              , ("defaultLanguage"   , "defaultLanguageL")
+              , ("cppOptions"        , "cppOptionsL")
+              , ("cSources"          , "cSourcesL")
+              , ("ccOptions"         , "ccOptionsL")
+              , ("extraLibDirs"      , "extraLibDirsL")
+              , ("extraLibs"         , "extraLibsL")
+              , ("ldOptions"         , "ldOptionsL")
+              , ("includeDirs"       , "includeDirsL")
+              , ("includes"          , "includesL")
+              ] ''PD.BuildInfo
+
+
 buildInfosOf :: S.Section -> CV.CondVars -> GenericPackageDescription -> [BuildInfo]
 buildInfosOf S.Library           = buildInfosOfLib
 buildInfosOf (S.Executable name) = buildInfosOfExe name
@@ -54,7 +68,7 @@
 buildInfosOfLib :: CV.CondVars -> GenericPackageDescription -> [BuildInfo]
 buildInfosOfLib vars pkgDescrp
    | Just condLib <- condLibrary pkgDescrp
-   = map libBuildInfo $ condTreeDatas vars condLib
+   = map (toBuildInfo PD.libBuildInfo) $ condTreeDatasAndConstraints vars condLib
 
    | otherwise
    = []
@@ -63,7 +77,7 @@
 buildInfosOfExe :: String -> CV.CondVars -> GenericPackageDescription -> [BuildInfo]
 buildInfosOfExe name vars pkgDescrp
    | Just (_, condExe) <- find ((== name) . fst) $ condExecutables pkgDescrp
-   = map buildInfo $ condTreeDatas vars condExe
+   = map (toBuildInfo PD.buildInfo) $ condTreeDatasAndConstraints vars condExe
 
    | otherwise
    = []
@@ -71,13 +85,13 @@
 
 buildInfosOfAllExes :: CV.CondVars -> GenericPackageDescription -> [BuildInfo]
 buildInfosOfAllExes vars pkgDescrp =
-   concat $ map ((map buildInfo) . (condTreeDatas vars) . snd) (condExecutables pkgDescrp)
+   concat $ map ((map (toBuildInfo PD.buildInfo)) . (condTreeDatasAndConstraints vars) . snd) (condExecutables pkgDescrp)
 
 
 buildInfosOfTest :: String -> CV.CondVars -> GenericPackageDescription -> [BuildInfo]
 buildInfosOfTest name vars pkgDescrp
    | Just (_, condTest) <- find ((== name) . fst) $ condTestSuites pkgDescrp
-   = map testBuildInfo $ condTreeDatas vars condTest
+   = map (toBuildInfo PD.testBuildInfo) $ condTreeDatasAndConstraints vars condTest
 
    | otherwise
    = []
@@ -85,13 +99,13 @@
 
 buildInfosOfAllTests :: CV.CondVars -> GenericPackageDescription -> [BuildInfo]
 buildInfosOfAllTests vars pkgDescrp =
-   concat $ map ((map testBuildInfo) . (condTreeDatas vars) . snd) (condTestSuites pkgDescrp)
+   concat $ map ((map (toBuildInfo PD.testBuildInfo)) . (condTreeDatasAndConstraints vars) . snd) (condTestSuites pkgDescrp)
 
 
 buildInfosOfBenchmark :: String -> CV.CondVars -> GenericPackageDescription -> [BuildInfo]
 buildInfosOfBenchmark name vars pkgDescrp
    | Just (_, condBench) <- find ((== name) . fst) $ condBenchmarks pkgDescrp
-   = map benchmarkBuildInfo $ condTreeDatas vars condBench
+   = map (toBuildInfo PD.benchmarkBuildInfo) $ condTreeDatasAndConstraints vars condBench
 
    | otherwise
    = []
@@ -99,40 +113,49 @@
 
 buildInfosOfAllBenchmarks :: CV.CondVars -> GenericPackageDescription -> [BuildInfo]
 buildInfosOfAllBenchmarks vars pkgDescrp =
-   concat $ map ((map benchmarkBuildInfo) . (condTreeDatas vars) . snd) (condBenchmarks pkgDescrp)
+   concat $ map ((map (toBuildInfo PD.benchmarkBuildInfo)) . (condTreeDatasAndConstraints vars) . snd) (condBenchmarks pkgDescrp)
 
 
--- | Returns all 'condTreeData' of the 'CondTree' which conditions match the given 'CondVars'. 
-condTreeDatas :: CV.CondVars -> CondTree ConfVar [Dependency] a -> [a]
-condTreeDatas vars tree = go (condTreeComponents tree) [condTreeData tree]
+toBuildInfo :: (dat -> PD.BuildInfo) -> (dat, [Dependency]) -> BuildInfo
+toBuildInfo f (dat, deps) = BuildInfo { buildInfo    = f dat
+                                      , buildDepends = deps
+                                      }
+
+
+-- | Returns all 'condTreeData' and 'condTreeConstraints' of the 'CondTree' which conditions match the given 'CondVars'.
+condTreeDatasAndConstraints :: CV.CondVars -> CondTree ConfVar [Dependency] dat -> [(dat, [Dependency])]
+condTreeDatasAndConstraints vars tree = go (condTreeComponents tree) [dataAndConstraints tree]
    where
       go [] dats = dats
 
       go ((cond, ifTree, elseTree) : comps) dats
          | CV.eval vars cond
-         = go comps $ go (condTreeComponents ifTree) (condTreeData ifTree : dats)
+         = go comps $ go (condTreeComponents ifTree) (dataAndConstraints ifTree : dats)
 
          | Just tree <- elseTree
-         = go comps $ go (condTreeComponents tree) (condTreeData tree : dats)
+         = go comps $ go (condTreeComponents tree) (dataAndConstraints tree : dats)
 
          | otherwise
          = go comps dats
 
+      dataAndConstraints tree = (condTreeData tree, condTreeConstraints tree)
 
+
 -- | A lens from a 'BuildInfo' to a list of stringified field entries of the 'BuildInfo'.
 field :: F.Field -> Traversal' BuildInfo [String]
-field F.Hs_Source_Dirs         = hsSourceDirsL
-field F.Ghc_Options            = optionsL . traversed . filtered ((== GHC) . fst) . _2
-field F.Default_Extensions     = oldAndDefaultExtensionsL . extsToStrings
-field F.Default_Language       = defaultLanguageL . langToString
-field F.Cpp_Options            = cppOptionsL
-field F.C_Sources              = cSourcesL
-field F.Cc_Options             = ccOptionsL
-field F.Extra_Lib_Dirs         = extraLibDirsL
-field F.Extra_Libraries        = extraLibsL
-field F.Ld_Options             = ldOptionsL
-field F.Include_Dirs           = includeDirsL
-field F.Includes               = includesL
+field F.Hs_Source_Dirs         = buildInfoL . hsSourceDirsL
+field F.Ghc_Options            = buildInfoL . optionsL . traversed . filtered ((== GHC) . fst) . _2
+field F.Default_Extensions     = buildInfoL . oldAndDefaultExtensionsL . extsToStrings
+field F.Default_Language       = buildInfoL . defaultLanguageL . langToString
+field F.Cpp_Options            = buildInfoL . cppOptionsL
+field F.C_Sources              = buildInfoL . cSourcesL
+field F.Cc_Options             = buildInfoL . ccOptionsL
+field F.Extra_Lib_Dirs         = buildInfoL . extraLibDirsL
+field F.Extra_Libraries        = buildInfoL . extraLibsL
+field F.Ld_Options             = buildInfoL . ldOptionsL
+field F.Include_Dirs           = buildInfoL . includeDirsL
+field F.Includes               = buildInfoL . includesL
+field F.Build_Depends          = buildDependsL . depsToStrings
 field F.Package_Db             = nopLens
 field F.Autogen_Hs_Source_Dirs = nopLens
 field F.Autogen_Include_Dirs   = nopLens
@@ -143,14 +166,14 @@
 -- | A lens that merges the fields 'default-extensions' and 'extensions',
 --   which now mean the same thing in cabal, 'extensions' is only the old
 --   name of 'default-extensions'.
-oldAndDefaultExtensionsL :: Lens' BuildInfo [Extension]
+oldAndDefaultExtensionsL :: Lens' PD.BuildInfo [Extension]
 oldAndDefaultExtensionsL = lens getter setter
    where
-      getter buildInfo      = (oldExtensions buildInfo) ++ (defaultExtensions buildInfo)
-      setter buildInfo exts = buildInfo { defaultExtensions = exts }
+      getter buildInfo      = (PD.oldExtensions buildInfo) ++ (PD.defaultExtensions buildInfo)
+      setter buildInfo exts = buildInfo { PD.defaultExtensions = exts }
 
 
--- | A lens (iso) that converts between a list of extensions
+-- | An iso that converts between a list of extensions
 --   and a list of strings containing the names of the extensions.
 extsToStrings :: Iso' [Extension] [String]
 extsToStrings = iso (map toString) (map toExt)
@@ -173,7 +196,7 @@
          = UnknownExtension str
 
 
--- | A lens (iso) that converts between the language and
+-- | An iso that converts between the language and
 --   a list containing a string with the name of the language.
 langToString :: Iso' (Maybe Language) [String]
 langToString = iso toString toLang
@@ -192,6 +215,14 @@
          = Just $ UnknownLanguage str
 
       toLang _ = Nothing
+
+
+-- | An iso that converts a list of dependencies to a list of package names
+depsToStrings :: Iso' [Dependency] [String]
+depsToStrings = iso (map toString) (map toDep)
+   where
+      toString (Dependency (PackageName name) _) = name
+      toDep name = Dependency (PackageName name) anyVersion
 
 
 -- | A lens that does nothing, always returns an empty
diff --git a/lib/CabalCargs/CompilerArgs.hs b/lib/CabalCargs/CompilerArgs.hs
--- a/lib/CabalCargs/CompilerArgs.hs
+++ b/lib/CabalCargs/CompilerArgs.hs
@@ -10,8 +10,7 @@
 import qualified CabalCargs.Spec as Spec
 import qualified CabalCargs.Args as A
 import qualified CabalCargs.Sections as S
-import qualified CabalCargs.Field as F
-import qualified CabalCargs.Fields as Fs
+import qualified CabalCargs.Fields as F
 import qualified CabalCargs.BuildInfo as B
 import Data.List (nub, foldl')
 import Control.Applicative ((<$>))
@@ -36,6 +35,7 @@
    , ldOptions           :: [String]
    , includeDirs         :: [FilePath]
    , includes            :: [String]
+   , buildDepends        :: [String]
    , packageDB           :: Maybe FilePath -- ^ the path to the package database of the cabal sandbox
    , autogenHsSourceDirs :: [FilePath]     -- ^ dirs of automatically generated haskell source files by cabal (e.g. Paths_*)
    , autogenIncludeDirs  :: [FilePath]     -- ^ dirs of automatically generated include files by cabal
@@ -57,6 +57,7 @@
               , ("ldOptions"          , "ldOptionsL")
               , ("includeDirs"        , "includeDirsL")
               , ("includes"           , "includesL")
+              , ("buildDepends"       , "buildDependsL")
               , ("packageDB"          , "packageDBL")
               , ("autogenHsSourceDirs", "autogenHsSourceDirsL")
               , ("autogenIncludeDirs" , "autogenIncludeDirsL")
@@ -104,7 +105,7 @@
          collectFields (buildInfosOf section) cargs
 
       collectFields buildInfos cargs =
-        foldl' (addCarg buildInfos) cargs fields
+        foldl' (addCarg buildInfos) cargs (Spec.fields spec)
         where
            addCarg _ cargs F.Package_Db  =
               cargs & packageDBL .~ Spec.packageDB spec
@@ -138,10 +139,6 @@
               where
                  buildInfoFields = concat $ map (^. B.field field) buildInfos
 
-           fields = case Spec.fields spec of
-                         Fs.Fields fs -> fs
-                         _            -> F.allFields
-
       buildInfos           = B.buildInfos (Spec.condVars spec) (Spec.cabalPackage spec)
       buildInfosOf section = B.buildInfosOf section (Spec.condVars spec) (Spec.cabalPackage spec)
 
@@ -159,6 +156,7 @@
 fieldL F.Ld_Options             = ldOptionsL
 fieldL F.Include_Dirs           = includeDirsL
 fieldL F.Includes               = includesL
+fieldL F.Build_Depends          = buildDependsL
 fieldL F.Package_Db             = error $ "Unexpected field Package_Db for CabalCargs.CompilerArgs.fieldL!"
 fieldL F.Autogen_Hs_Source_Dirs = autogenHsSourceDirsL
 fieldL F.Autogen_Include_Dirs   = autogenIncludeDirsL
@@ -180,6 +178,7 @@
    , ldOptions           = []
    , includeDirs         = []
    , includes            = []
+   , buildDepends        = []
    , packageDB           = Nothing
    , autogenHsSourceDirs = []
    , autogenIncludeDirs  = []
diff --git a/lib/CabalCargs/Field.hs b/lib/CabalCargs/Field.hs
deleted file mode 100644
--- a/lib/CabalCargs/Field.hs
+++ /dev/null
@@ -1,39 +0,0 @@
-{-# LANGUAGE DeriveDataTypeable #-}
-
-module CabalCargs.Field
-   ( Field(..)
-   , allFields
-   ) where
-
-import Data.Data (Data, Typeable)
-
--- | A compiler relevant field. Till 'Package_Db' all fields are from the cabal file
---   with the same name, just with lower case letters and the '_' replaced by a '-'.
-data Field = Hs_Source_Dirs
-           | Ghc_Options
-           | Default_Extensions
-           | Default_Language
-
-           | Cpp_Options
-           | C_Sources
-           | Cc_Options
-
-           | Extra_Lib_Dirs
-           | Extra_Libraries
-           | Ld_Options
-
-           | Include_Dirs
-           | Includes
-
-           | Package_Db             -- ^ the package database of a cabal sandbox
-           | Autogen_Hs_Source_Dirs -- ^ dirs of automatically generated haskell source files by cabal (e.g. Paths_*)
-           | Autogen_Include_Dirs   -- ^ dirs of automatically generated include files by cabal
-           | Autogen_Includes       -- ^ automatically generated include files by cabal (e.g. cabal_macros.h)
-
-           | Hdevtools_Socket       -- ^ the socket file for hdevtools
-           deriving (Data, Typeable, Show, Eq, Enum, Bounded)
-
-
--- | Get all known fields.
-allFields :: [Field]
-allFields = [ minBound .. maxBound ]
diff --git a/lib/CabalCargs/Fields.hs b/lib/CabalCargs/Fields.hs
--- a/lib/CabalCargs/Fields.hs
+++ b/lib/CabalCargs/Fields.hs
@@ -1,26 +1,46 @@
-{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE DeriveDataTypeable, PatternGuards #-}
 
 module CabalCargs.Fields
-   ( Fields(..)
-   , fields
+   ( Field(..)
+   , allFields
+   , Fields
    ) where
 
-import CabalCargs.Args (Args)
-import qualified CabalCargs.Args as Args
-import qualified CabalCargs.Field as F
+import Data.Data (Data, Typeable)
 
+-- | A compiler relevant field. Till 'Package_Db' all fields are from the cabal file
+--   with the same name, just with lower case letters and the "_" replaced by a "-".
+data Field = Hs_Source_Dirs
+           | Ghc_Options
+           | Default_Extensions
+           | Default_Language
 
--- | Which fields should be considered for the print out.
-data Fields = AllFields        -- ^ all fields are printed out
-            | Fields [F.Field] -- ^ only these fields are printed out
-            deriving (Show, Eq)
+           | Cpp_Options
+           | C_Sources
+           | Cc_Options
 
+           | Extra_Lib_Dirs
+           | Extra_Libraries
+           | Ld_Options
 
--- | Convert the command line arguments into 'Fields'.
-fields :: Args -> Fields
-fields args
-   | fs@(_:_) <- Args.only args
-   = Fields fs
+           | Include_Dirs
+           | Includes
 
-   | otherwise
-   = AllFields
+           | Build_Depends
+
+           | Package_Db             -- ^ the package database of a cabal sandbox
+           | Autogen_Hs_Source_Dirs -- ^ dirs of automatically generated haskell source files by cabal (e.g. Paths_*)
+           | Autogen_Include_Dirs   -- ^ dirs of automatically generated include files by cabal
+           | Autogen_Includes       -- ^ automatically generated include files by cabal (e.g. cabal_macros.h)
+
+           | Hdevtools_Socket       -- ^ the socket file for hdevtools
+           deriving (Data, Typeable, Show, Eq, Enum, Bounded)
+
+
+-- | Get all known fields.
+allFields :: [Field]
+allFields = [ minBound .. maxBound ]
+
+
+-- | Which fields should be collected
+type Fields = [Field]
diff --git a/lib/CabalCargs/Format.hs b/lib/CabalCargs/Format.hs
--- a/lib/CabalCargs/Format.hs
+++ b/lib/CabalCargs/Format.hs
@@ -21,12 +21,16 @@
                           , map ("-l" ++) (extraLibraries cargs)
                           , formatIncludeDirs $ includeDirs cargs
                           , formatIncludes $ includes cargs
+                          , formatBuildDepends $ buildDepends cargs
                           , maybe [] (\db -> ["-package-conf=" ++ db]) (packageDB cargs)
                           , formatHsSourceDirs $ autogenHsSourceDirs cargs
                           , formatIncludeDirs $ autogenIncludeDirs cargs
                           , formatIncludes $ autogenIncludes cargs
                           ]
    where
+      formatBuildDepends []   = []
+      formatBuildDepends deps = map ("-package=" ++) deps
+
       formatHsSourceDirs = map ("-i" ++)
       formatIncludeDirs  = map ("-I" ++)
 
@@ -52,6 +56,7 @@
                            , ldOptions cargs
                            , includeDirs cargs
                            , includes cargs
+                           , buildDepends cargs
                            , maybeToList $ packageDB cargs
                            , autogenHsSourceDirs cargs
                            , autogenIncludeDirs cargs
diff --git a/lib/CabalCargs/Sections.hs b/lib/CabalCargs/Sections.hs
--- a/lib/CabalCargs/Sections.hs
+++ b/lib/CabalCargs/Sections.hs
@@ -1,13 +1,9 @@
-{-# LANGUAGE PatternGuards #-}
 
 module CabalCargs.Sections
    ( Sections(..)
    , Section(..)
-   , sections
    ) where
 
-import CabalCargs.Args (Args)
-import qualified CabalCargs.Args as A
 
 -- | A section of the cabal file.
 data Section = Library
@@ -16,21 +12,8 @@
              | Benchmark String
              deriving (Show, Eq)
 
+
 -- | From which sections the compiler args should be collected.
 data Sections = AllSections        -- ^ all sections are considered
               | Sections [Section] -- ^ only these sections are considered
               deriving (Show, Eq)
-
-
--- | Convert the command line arguments into 'Sections'.
-sections :: Args -> Sections
-sections args 
-   | ss@(_:_) <- concat [ [Library | A.library args]
-                        , map Executable (A.executable args)
-                        , map TestSuite (A.testSuite args)
-                        , map Benchmark (A.benchmark args)
-                        ]
-   = Sections ss
-
-   | otherwise
-   = AllSections
diff --git a/lib/CabalCargs/Spec.hs b/lib/CabalCargs/Spec.hs
--- a/lib/CabalCargs/Spec.hs
+++ b/lib/CabalCargs/Spec.hs
@@ -25,7 +25,7 @@
 import Filesystem.Path.CurrentOS ((</>))
 import qualified Filesystem as FS
 import qualified Data.Text as T
-import Data.List (find, isPrefixOf)
+import Data.List (find, isPrefixOf, (\\))
 import qualified Data.List as L
 import Data.Maybe (isJust)
 
@@ -58,49 +58,54 @@
 fromCmdArgs :: Args -> IO (Either Error Spec)
 fromCmdArgs args
    | Just cabalFile <- A.cabalFile args = runEitherT $ do
-      spec        <- fromCabalFile cabalFile (S.sections args) (F.fields args)
+      spec        <- fromCabalFile cabalFile
       srcSections <- io $ case A.sourceFile args of
                                Just srcFile -> findSections srcFile cabalFile (cabalPackage spec)
                                _            -> return []
 
-      right $ applyCondVars $ spec { sections      = combineSections (sections spec) srcSections
+      right $ applyCondVars $ spec { sections      = combineSections args srcSections
+                                   , fields        = fields_ args
                                    , relativePaths = A.relative args
                                    }
 
    | Just sourceFile <- A.sourceFile args = runEitherT $ do
-      spec <- fromSourceFile sourceFile (F.fields args)
-      let specSections = case sections spec of
-                              S.Sections ss -> ss
-                              _             -> []
+      spec <- fromSourceFile sourceFile
+      let srcSections = case sections spec of
+                             S.Sections ss -> ss
+                             _             -> []
 
-      right $ applyCondVars $ spec { sections      = combineSections (S.sections args) specSections
+      right $ applyCondVars $ spec { sections      = combineSections args srcSections
+                                   , fields        = fields_ args
                                    , relativePaths = A.relative args
                                    }
 
    | otherwise = runEitherT $ do
       curDir    <- io $ getCurrentDirectory
       cabalFile <- findCabalFile curDir
-      spec      <- fromCabalFile cabalFile (S.sections args) (F.fields args)
-      right $ applyCondVars $ spec { relativePaths = A.relative args }
+      spec      <- fromCabalFile cabalFile
+      right $ applyCondVars $ spec { sections      = sections_ args
+                                   , fields        = fields_ args
+                                   , relativePaths = A.relative args
+                                   }
 
    where
       applyCondVars = applyFlags args . applyOS args . applyArch args
 
 
 
--- | Create a 'Spec' from the given cabal file, sections and fields.
+-- | Create a 'Spec' from the given cabal file.
 --
 --   If a cabal sandbox is present in the directory of the cabal file, then
 --   the path to its package database is also returned.
-fromCabalFile :: FilePath -> S.Sections -> F.Fields -> EitherT Error IO Spec
-fromCabalFile file sections fields = do
+fromCabalFile :: FilePath -> EitherT Error IO Spec
+fromCabalFile file = do
    pkgDescrp <- packageDescription file
    pkgDB     <- findPackageDB file
    distDir   <- io $ findDistDir file
    absFile   <- FP.encodeString <$> (io $ absoluteFile file)
    right $ Spec
-      { sections      = sections
-      , fields        = fields
+      { sections      = S.AllSections
+      , fields        = F.allFields
       , condVars      = CV.fromDefaults pkgDescrp
       , cabalPackage  = pkgDescrp
       , cabalFile     = absFile
@@ -110,7 +115,7 @@
       }
 
 
--- | Create a 'Spec' from the given source file and fields.
+-- | Create a 'Spec' from the given source file.
 --
 --   Starting at the directory of the source file a cabal file is searched
 --   upwards the directory tree.
@@ -120,16 +125,16 @@
 --
 --   If a cabal sandbox is present in the directory of the cabal file, then
 --   the path to its package database is also returned.
-fromSourceFile :: FilePath -> F.Fields -> EitherT Error IO Spec
-fromSourceFile file fields = do
+fromSourceFile :: FilePath -> EitherT Error IO Spec
+fromSourceFile file = do
    cabalFile   <- findCabalFile file
    pkgDB       <- findPackageDB cabalFile
    distDir     <- io $ findDistDir cabalFile
    pkgDescrp   <- packageDescription cabalFile
    srcSections <- io $ findSections file cabalFile pkgDescrp
    right $ Spec
-      { sections = combineSections S.AllSections srcSections
-      , fields        = fields
+      { sections      = S.Sections srcSections
+      , fields        = F.allFields
       , condVars      = CV.fromDefaults pkgDescrp
       , cabalPackage  = pkgDescrp
       , cabalFile     = cabalFile
@@ -212,7 +217,7 @@
 allHsSourceDirs pkgDescrp = map fromBuildInfo buildInfos
    where
       fromBuildInfo (section, buildInfos) =
-         (section, toFPs $ concat $ (map PD.hsSourceDirs) (buildInfos condVars pkgDescrp))
+         (section, toFPs $ concat $ (map (PD.hsSourceDirs . B.buildInfo)) (buildInfos condVars pkgDescrp))
 
       buildInfos = concat [ [ (S.Library, B.buildInfosOfLib) | isJust $ PD.condLibrary pkgDescrp ]
                           , map fromExe (PD.condExecutables pkgDescrp)
@@ -334,7 +339,49 @@
    = FP.encodeString file
 
 
-combineSections :: S.Sections -> [S.Section] -> S.Sections
-combineSections S.AllSections     [] = S.AllSections
-combineSections S.AllSections     ss = S.Sections ss
-combineSections (S.Sections ss)    _ = S.Sections ss
+combineSections :: Args -> [S.Section] -> S.Sections
+combineSections args sections
+   | A.allSections args
+   = S.AllSections
+
+   | [] <- explicitSections args
+   , null sections
+   = S.AllSections
+
+   | otherwise
+   = S.Sections $ explicitSections args ++ sections
+
+
+-- | Convert the command line arguments into 'Fields'.
+fields_ :: Args -> F.Fields
+fields_ args
+   | fs@(_:_) <- A.only args
+   = fs
+
+   | fs@(_:_) <- A.ignore args
+   = F.allFields \\ fs
+
+   | otherwise
+   = F.allFields
+
+
+-- | Convert the command line arguments into 'Sections'.
+sections_ :: Args -> S.Sections
+sections_ args
+   | A.allSections args
+   = S.AllSections
+
+   | ss@(_:_) <- explicitSections args
+   = S.Sections ss
+
+   | otherwise
+   = S.AllSections
+
+
+explicitSections :: Args -> [S.Section]
+explicitSections args =
+   concat [ [S.Library | A.library args]
+          , map S.Executable (A.executable args)
+          , map S.TestSuite (A.testSuite args)
+          , map S.Benchmark (A.benchmark args)
+          ]
diff --git a/tests/Main.hs b/tests/Main.hs
--- a/tests/Main.hs
+++ b/tests/Main.hs
@@ -7,7 +7,7 @@
 import System.FilePath ((</>), (<.>))
 import CabalCargs.Args
 import CabalCargs.Formatting
-import qualified CabalCargs.Field as F
+import qualified CabalCargs.Fields as F
 import qualified CabalCargs.Format as Fmt
 import qualified CabalCargs.CompilerArgs as CompilerArgs
 import Data.List (intercalate)
@@ -56,6 +56,9 @@
    , test dir "EnableFlag" $ defaultArgs { cabalFile = cabalFile, enable = ["default_false_flag"] }
    , test dir "DisableFlag" $ defaultArgs { cabalFile = cabalFile, disable = ["default_true_flag"] }
    , test dir "EnableAndDisableFlag" $ defaultArgs { cabalFile = cabalFile, enable = ["default_false_flag"], disable = ["default_true_flag"] }
+
+   , test dir "IgnoreBuildDepends" $ defaultArgs { cabalFile = cabalFile, ignore = [F.Build_Depends] }
+   , test dir "AllSections" $ defaultArgs { sourceFile = libSrcFile, allSections = True }
    ]
 
    where
@@ -87,17 +90,19 @@
 
 defaultArgs :: Args
 defaultArgs = Args
-   { library    = False
-   , executable = []
-   , testSuite  = []
-   , benchmark  = []
-   , only       = []
-   , format     = Ghc
-   , sourceFile = Nothing
-   , cabalFile  = Nothing
-   , enable     = []
-   , disable    = []
-   , os         = Nothing
-   , arch       = Nothing
-   , relative   = True
+   { library     = False
+   , executable  = []
+   , testSuite   = []
+   , benchmark   = []
+   , allSections = False
+   , only        = []
+   , ignore      = []
+   , format      = Ghc
+   , sourceFile  = Nothing
+   , cabalFile   = Nothing
+   , enable      = []
+   , disable     = []
+   , os          = Nothing
+   , arch        = Nothing
+   , relative    = True
    }
diff --git a/tests/goldenFiles/withSandbox/AllOfExe.txt b/tests/goldenFiles/withSandbox/AllOfExe.txt
--- a/tests/goldenFiles/withSandbox/AllOfExe.txt
+++ b/tests/goldenFiles/withSandbox/AllOfExe.txt
@@ -1,1 +1,1 @@
--iexe -W -optP-DEXE -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
+-iexe -W -optP-DEXE -package=base -package=cabal-cargs -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withSandbox/AllOfLib.txt b/tests/goldenFiles/withSandbox/AllOfLib.txt
--- a/tests/goldenFiles/withSandbox/AllOfLib.txt
+++ b/tests/goldenFiles/withSandbox/AllOfLib.txt
@@ -1,1 +1,1 @@
--ilib -W -optP-DLIB -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
+-ilib -W -optP-DLIB -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withSandbox/AllOfTest.txt b/tests/goldenFiles/withSandbox/AllOfTest.txt
--- a/tests/goldenFiles/withSandbox/AllOfTest.txt
+++ b/tests/goldenFiles/withSandbox/AllOfTest.txt
@@ -1,1 +1,1 @@
--itests -W -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
+-itests -W -package=base -package=tasty -package=tasty-golden -package=filepath -package=cabal-cargs -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withSandbox/AllSections.txt b/tests/goldenFiles/withSandbox/AllSections.txt
new file mode 100644
--- /dev/null
+++ b/tests/goldenFiles/withSandbox/AllSections.txt
@@ -0,0 +1,1 @@
+-ilib -iexe -itests -W -optP-DLIB -optP-DEXE -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package=cabal-cargs -package=tasty -package=tasty-golden -package=filepath -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withSandbox/DisableFlag.txt b/tests/goldenFiles/withSandbox/DisableFlag.txt
--- a/tests/goldenFiles/withSandbox/DisableFlag.txt
+++ b/tests/goldenFiles/withSandbox/DisableFlag.txt
@@ -1,1 +1,1 @@
--ilib -iexe -itests -W -optP-DEXE -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
+-ilib -iexe -itests -W -optP-DEXE -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package=cabal-cargs -package=tasty -package=tasty-golden -package=filepath -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withSandbox/EnableAndDisableFlag.txt b/tests/goldenFiles/withSandbox/EnableAndDisableFlag.txt
--- a/tests/goldenFiles/withSandbox/EnableAndDisableFlag.txt
+++ b/tests/goldenFiles/withSandbox/EnableAndDisableFlag.txt
@@ -1,1 +1,1 @@
--ilib -iexe -itests -W -optP-DEXE -optP-DTEST -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
+-ilib -iexe -itests -W -optP-DEXE -optP-DTEST -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package=cabal-cargs -package=tasty -package=tasty-golden -package=filepath -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withSandbox/EnableFlag.txt b/tests/goldenFiles/withSandbox/EnableFlag.txt
--- a/tests/goldenFiles/withSandbox/EnableFlag.txt
+++ b/tests/goldenFiles/withSandbox/EnableFlag.txt
@@ -1,1 +1,1 @@
--ilib -iexe -itests -W -optP-DLIB -optP-DEXE -optP-DTEST -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
+-ilib -iexe -itests -W -optP-DLIB -optP-DEXE -optP-DTEST -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package=cabal-cargs -package=tasty -package=tasty-golden -package=filepath -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withSandbox/FindCabalFile.txt b/tests/goldenFiles/withSandbox/FindCabalFile.txt
--- a/tests/goldenFiles/withSandbox/FindCabalFile.txt
+++ b/tests/goldenFiles/withSandbox/FindCabalFile.txt
@@ -1,1 +1,1 @@
--ilib -iexe -itests -W -optP-DLIB -optP-DEXE -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
+-ilib -iexe -itests -W -optP-DLIB -optP-DEXE -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package=cabal-cargs -package=tasty -package=tasty-golden -package=filepath -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withSandbox/FindCabalFileHdevtools.txt b/tests/goldenFiles/withSandbox/FindCabalFileHdevtools.txt
--- a/tests/goldenFiles/withSandbox/FindCabalFileHdevtools.txt
+++ b/tests/goldenFiles/withSandbox/FindCabalFileHdevtools.txt
@@ -1,1 +1,1 @@
--g-ilib -g-iexe -g-itests -g-W -g-optP-DLIB -g-optP-DEXE -g-package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -g-idist/dist-sandbox-6d1acfa0/build/autogen -g-Idist/dist-sandbox-6d1acfa0/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
+-g-ilib -g-iexe -g-itests -g-W -g-optP-DLIB -g-optP-DEXE -g-package=base -g-package=cmdargs -g-package=lens -g-package=directory -g-package=strict -g-package=transformers -g-package=either -g-package=text -g-package=system-filepath -g-package=system-fileio -g-package=Cabal -g-package=cabal-cargs -g-package=tasty -g-package=tasty-golden -g-package=filepath -g-package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -g-idist/dist-sandbox-6d1acfa0/build/autogen -g-Idist/dist-sandbox-6d1acfa0/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
diff --git a/tests/goldenFiles/withSandbox/FindCabalFilePure.txt b/tests/goldenFiles/withSandbox/FindCabalFilePure.txt
--- a/tests/goldenFiles/withSandbox/FindCabalFilePure.txt
+++ b/tests/goldenFiles/withSandbox/FindCabalFilePure.txt
@@ -1,1 +1,1 @@
-lib exe tests -W -DLIB -DEXE .cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d dist/dist-sandbox-6d1acfa0/build/autogen dist/dist-sandbox-6d1acfa0/build/autogen cabal_macros.h .hdevtools.sock
+lib exe tests -W -DLIB -DEXE base cmdargs lens directory strict transformers either text system-filepath system-fileio Cabal cabal-cargs tasty tasty-golden filepath .cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d dist/dist-sandbox-6d1acfa0/build/autogen dist/dist-sandbox-6d1acfa0/build/autogen cabal_macros.h .hdevtools.sock
diff --git a/tests/goldenFiles/withSandbox/FromCabalFile.txt b/tests/goldenFiles/withSandbox/FromCabalFile.txt
--- a/tests/goldenFiles/withSandbox/FromCabalFile.txt
+++ b/tests/goldenFiles/withSandbox/FromCabalFile.txt
@@ -1,1 +1,1 @@
--ilib -iexe -itests -W -optP-DLIB -optP-DEXE -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
+-ilib -iexe -itests -W -optP-DLIB -optP-DEXE -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package=cabal-cargs -package=tasty -package=tasty-golden -package=filepath -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withSandbox/FromCabalFileHdevtools.txt b/tests/goldenFiles/withSandbox/FromCabalFileHdevtools.txt
--- a/tests/goldenFiles/withSandbox/FromCabalFileHdevtools.txt
+++ b/tests/goldenFiles/withSandbox/FromCabalFileHdevtools.txt
@@ -1,1 +1,1 @@
--g-ilib -g-iexe -g-itests -g-W -g-optP-DLIB -g-optP-DEXE -g-package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -g-idist/dist-sandbox-6d1acfa0/build/autogen -g-Idist/dist-sandbox-6d1acfa0/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
+-g-ilib -g-iexe -g-itests -g-W -g-optP-DLIB -g-optP-DEXE -g-package=base -g-package=cmdargs -g-package=lens -g-package=directory -g-package=strict -g-package=transformers -g-package=either -g-package=text -g-package=system-filepath -g-package=system-fileio -g-package=Cabal -g-package=cabal-cargs -g-package=tasty -g-package=tasty-golden -g-package=filepath -g-package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -g-idist/dist-sandbox-6d1acfa0/build/autogen -g-Idist/dist-sandbox-6d1acfa0/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
diff --git a/tests/goldenFiles/withSandbox/FromCabalFilePure.txt b/tests/goldenFiles/withSandbox/FromCabalFilePure.txt
--- a/tests/goldenFiles/withSandbox/FromCabalFilePure.txt
+++ b/tests/goldenFiles/withSandbox/FromCabalFilePure.txt
@@ -1,1 +1,1 @@
-lib exe tests -W -DLIB -DEXE .cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d dist/dist-sandbox-6d1acfa0/build/autogen dist/dist-sandbox-6d1acfa0/build/autogen cabal_macros.h .hdevtools.sock
+lib exe tests -W -DLIB -DEXE base cmdargs lens directory strict transformers either text system-filepath system-fileio Cabal cabal-cargs tasty tasty-golden filepath .cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d dist/dist-sandbox-6d1acfa0/build/autogen dist/dist-sandbox-6d1acfa0/build/autogen cabal_macros.h .hdevtools.sock
diff --git a/tests/goldenFiles/withSandbox/FromExeSrcFile.txt b/tests/goldenFiles/withSandbox/FromExeSrcFile.txt
--- a/tests/goldenFiles/withSandbox/FromExeSrcFile.txt
+++ b/tests/goldenFiles/withSandbox/FromExeSrcFile.txt
@@ -1,1 +1,1 @@
--iexe -W -optP-DEXE -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
+-iexe -W -optP-DEXE -package=base -package=cabal-cargs -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withSandbox/FromExeSrcFileHdevtools.txt b/tests/goldenFiles/withSandbox/FromExeSrcFileHdevtools.txt
--- a/tests/goldenFiles/withSandbox/FromExeSrcFileHdevtools.txt
+++ b/tests/goldenFiles/withSandbox/FromExeSrcFileHdevtools.txt
@@ -1,1 +1,1 @@
--g-iexe -g-W -g-optP-DEXE -g-package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -g-idist/dist-sandbox-6d1acfa0/build/autogen -g-Idist/dist-sandbox-6d1acfa0/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
+-g-iexe -g-W -g-optP-DEXE -g-package=base -g-package=cabal-cargs -g-package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -g-idist/dist-sandbox-6d1acfa0/build/autogen -g-Idist/dist-sandbox-6d1acfa0/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
diff --git a/tests/goldenFiles/withSandbox/FromExeSrcFilePure.txt b/tests/goldenFiles/withSandbox/FromExeSrcFilePure.txt
--- a/tests/goldenFiles/withSandbox/FromExeSrcFilePure.txt
+++ b/tests/goldenFiles/withSandbox/FromExeSrcFilePure.txt
@@ -1,1 +1,1 @@
-exe -W -DEXE .cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d dist/dist-sandbox-6d1acfa0/build/autogen dist/dist-sandbox-6d1acfa0/build/autogen cabal_macros.h .hdevtools.sock
+exe -W -DEXE base cabal-cargs .cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d dist/dist-sandbox-6d1acfa0/build/autogen dist/dist-sandbox-6d1acfa0/build/autogen cabal_macros.h .hdevtools.sock
diff --git a/tests/goldenFiles/withSandbox/FromLibSrcFile.txt b/tests/goldenFiles/withSandbox/FromLibSrcFile.txt
--- a/tests/goldenFiles/withSandbox/FromLibSrcFile.txt
+++ b/tests/goldenFiles/withSandbox/FromLibSrcFile.txt
@@ -1,1 +1,1 @@
--ilib -W -optP-DLIB -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
+-ilib -W -optP-DLIB -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withSandbox/FromLibSrcFileHdevtools.txt b/tests/goldenFiles/withSandbox/FromLibSrcFileHdevtools.txt
--- a/tests/goldenFiles/withSandbox/FromLibSrcFileHdevtools.txt
+++ b/tests/goldenFiles/withSandbox/FromLibSrcFileHdevtools.txt
@@ -1,1 +1,1 @@
--g-ilib -g-W -g-optP-DLIB -g-package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -g-idist/dist-sandbox-6d1acfa0/build/autogen -g-Idist/dist-sandbox-6d1acfa0/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
+-g-ilib -g-W -g-optP-DLIB -g-package=base -g-package=cmdargs -g-package=lens -g-package=directory -g-package=strict -g-package=transformers -g-package=either -g-package=text -g-package=system-filepath -g-package=system-fileio -g-package=Cabal -g-package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -g-idist/dist-sandbox-6d1acfa0/build/autogen -g-Idist/dist-sandbox-6d1acfa0/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
diff --git a/tests/goldenFiles/withSandbox/FromLibSrcPure.txt b/tests/goldenFiles/withSandbox/FromLibSrcPure.txt
--- a/tests/goldenFiles/withSandbox/FromLibSrcPure.txt
+++ b/tests/goldenFiles/withSandbox/FromLibSrcPure.txt
@@ -1,1 +1,1 @@
-lib -W -DLIB .cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d dist/dist-sandbox-6d1acfa0/build/autogen dist/dist-sandbox-6d1acfa0/build/autogen cabal_macros.h .hdevtools.sock
+lib -W -DLIB base cmdargs lens directory strict transformers either text system-filepath system-fileio Cabal .cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d dist/dist-sandbox-6d1acfa0/build/autogen dist/dist-sandbox-6d1acfa0/build/autogen cabal_macros.h .hdevtools.sock
diff --git a/tests/goldenFiles/withSandbox/IgnoreBuildDepends.txt b/tests/goldenFiles/withSandbox/IgnoreBuildDepends.txt
new file mode 100644
--- /dev/null
+++ b/tests/goldenFiles/withSandbox/IgnoreBuildDepends.txt
@@ -0,0 +1,1 @@
+-ilib -iexe -itests -W -optP-DLIB -optP-DEXE -package-conf=.cabal-sandbox/x86_64-linux-ghc-7.6.2-packages.conf.d -idist/dist-sandbox-6d1acfa0/build/autogen -Idist/dist-sandbox-6d1acfa0/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withoutSandbox/AllOfExe.txt b/tests/goldenFiles/withoutSandbox/AllOfExe.txt
--- a/tests/goldenFiles/withoutSandbox/AllOfExe.txt
+++ b/tests/goldenFiles/withoutSandbox/AllOfExe.txt
@@ -1,1 +1,1 @@
--iexe -W -optP-DEXE -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
+-iexe -W -optP-DEXE -package=base -package=cabal-cargs -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withoutSandbox/AllOfLib.txt b/tests/goldenFiles/withoutSandbox/AllOfLib.txt
--- a/tests/goldenFiles/withoutSandbox/AllOfLib.txt
+++ b/tests/goldenFiles/withoutSandbox/AllOfLib.txt
@@ -1,1 +1,1 @@
--ilib -W -optP-DLIB -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
+-ilib -W -optP-DLIB -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withoutSandbox/AllOfTest.txt b/tests/goldenFiles/withoutSandbox/AllOfTest.txt
--- a/tests/goldenFiles/withoutSandbox/AllOfTest.txt
+++ b/tests/goldenFiles/withoutSandbox/AllOfTest.txt
@@ -1,1 +1,1 @@
--itests -W -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
+-itests -W -package=base -package=tasty -package=tasty-golden -package=filepath -package=cabal-cargs -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withoutSandbox/AllSections.txt b/tests/goldenFiles/withoutSandbox/AllSections.txt
new file mode 100644
--- /dev/null
+++ b/tests/goldenFiles/withoutSandbox/AllSections.txt
@@ -0,0 +1,1 @@
+-ilib -iexe -itests -W -optP-DLIB -optP-DEXE -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package=cabal-cargs -package=tasty -package=tasty-golden -package=filepath -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withoutSandbox/DisableFlag.txt b/tests/goldenFiles/withoutSandbox/DisableFlag.txt
--- a/tests/goldenFiles/withoutSandbox/DisableFlag.txt
+++ b/tests/goldenFiles/withoutSandbox/DisableFlag.txt
@@ -1,1 +1,1 @@
--ilib -iexe -itests -W -optP-DEXE -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
+-ilib -iexe -itests -W -optP-DEXE -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package=cabal-cargs -package=tasty -package=tasty-golden -package=filepath -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withoutSandbox/EnableAndDisableFlag.txt b/tests/goldenFiles/withoutSandbox/EnableAndDisableFlag.txt
--- a/tests/goldenFiles/withoutSandbox/EnableAndDisableFlag.txt
+++ b/tests/goldenFiles/withoutSandbox/EnableAndDisableFlag.txt
@@ -1,1 +1,1 @@
--ilib -iexe -itests -W -optP-DEXE -optP-DTEST -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
+-ilib -iexe -itests -W -optP-DEXE -optP-DTEST -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package=cabal-cargs -package=tasty -package=tasty-golden -package=filepath -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withoutSandbox/EnableFlag.txt b/tests/goldenFiles/withoutSandbox/EnableFlag.txt
--- a/tests/goldenFiles/withoutSandbox/EnableFlag.txt
+++ b/tests/goldenFiles/withoutSandbox/EnableFlag.txt
@@ -1,1 +1,1 @@
--ilib -iexe -itests -W -optP-DLIB -optP-DEXE -optP-DTEST -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
+-ilib -iexe -itests -W -optP-DLIB -optP-DEXE -optP-DTEST -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package=cabal-cargs -package=tasty -package=tasty-golden -package=filepath -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withoutSandbox/FindCabalFile.txt b/tests/goldenFiles/withoutSandbox/FindCabalFile.txt
--- a/tests/goldenFiles/withoutSandbox/FindCabalFile.txt
+++ b/tests/goldenFiles/withoutSandbox/FindCabalFile.txt
@@ -1,1 +1,1 @@
--ilib -iexe -itests -W -optP-DLIB -optP-DEXE -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
+-ilib -iexe -itests -W -optP-DLIB -optP-DEXE -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package=cabal-cargs -package=tasty -package=tasty-golden -package=filepath -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withoutSandbox/FindCabalFileHdevtools.txt b/tests/goldenFiles/withoutSandbox/FindCabalFileHdevtools.txt
--- a/tests/goldenFiles/withoutSandbox/FindCabalFileHdevtools.txt
+++ b/tests/goldenFiles/withoutSandbox/FindCabalFileHdevtools.txt
@@ -1,1 +1,1 @@
--g-ilib -g-iexe -g-itests -g-W -g-optP-DLIB -g-optP-DEXE -g-idist/build/autogen -g-Idist/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
+-g-ilib -g-iexe -g-itests -g-W -g-optP-DLIB -g-optP-DEXE -g-package=base -g-package=cmdargs -g-package=lens -g-package=directory -g-package=strict -g-package=transformers -g-package=either -g-package=text -g-package=system-filepath -g-package=system-fileio -g-package=Cabal -g-package=cabal-cargs -g-package=tasty -g-package=tasty-golden -g-package=filepath -g-idist/build/autogen -g-Idist/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
diff --git a/tests/goldenFiles/withoutSandbox/FindCabalFilePure.txt b/tests/goldenFiles/withoutSandbox/FindCabalFilePure.txt
--- a/tests/goldenFiles/withoutSandbox/FindCabalFilePure.txt
+++ b/tests/goldenFiles/withoutSandbox/FindCabalFilePure.txt
@@ -1,1 +1,1 @@
-lib exe tests -W -DLIB -DEXE dist/build/autogen dist/build/autogen cabal_macros.h .hdevtools.sock
+lib exe tests -W -DLIB -DEXE base cmdargs lens directory strict transformers either text system-filepath system-fileio Cabal cabal-cargs tasty tasty-golden filepath dist/build/autogen dist/build/autogen cabal_macros.h .hdevtools.sock
diff --git a/tests/goldenFiles/withoutSandbox/FromCabalFile.txt b/tests/goldenFiles/withoutSandbox/FromCabalFile.txt
--- a/tests/goldenFiles/withoutSandbox/FromCabalFile.txt
+++ b/tests/goldenFiles/withoutSandbox/FromCabalFile.txt
@@ -1,1 +1,1 @@
--ilib -iexe -itests -W -optP-DLIB -optP-DEXE -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
+-ilib -iexe -itests -W -optP-DLIB -optP-DEXE -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -package=cabal-cargs -package=tasty -package=tasty-golden -package=filepath -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withoutSandbox/FromCabalFileHdevtools.txt b/tests/goldenFiles/withoutSandbox/FromCabalFileHdevtools.txt
--- a/tests/goldenFiles/withoutSandbox/FromCabalFileHdevtools.txt
+++ b/tests/goldenFiles/withoutSandbox/FromCabalFileHdevtools.txt
@@ -1,1 +1,1 @@
--g-ilib -g-iexe -g-itests -g-W -g-optP-DLIB -g-optP-DEXE -g-idist/build/autogen -g-Idist/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
+-g-ilib -g-iexe -g-itests -g-W -g-optP-DLIB -g-optP-DEXE -g-package=base -g-package=cmdargs -g-package=lens -g-package=directory -g-package=strict -g-package=transformers -g-package=either -g-package=text -g-package=system-filepath -g-package=system-fileio -g-package=Cabal -g-package=cabal-cargs -g-package=tasty -g-package=tasty-golden -g-package=filepath -g-idist/build/autogen -g-Idist/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
diff --git a/tests/goldenFiles/withoutSandbox/FromCabalFilePure.txt b/tests/goldenFiles/withoutSandbox/FromCabalFilePure.txt
--- a/tests/goldenFiles/withoutSandbox/FromCabalFilePure.txt
+++ b/tests/goldenFiles/withoutSandbox/FromCabalFilePure.txt
@@ -1,1 +1,1 @@
-lib exe tests -W -DLIB -DEXE dist/build/autogen dist/build/autogen cabal_macros.h .hdevtools.sock
+lib exe tests -W -DLIB -DEXE base cmdargs lens directory strict transformers either text system-filepath system-fileio Cabal cabal-cargs tasty tasty-golden filepath dist/build/autogen dist/build/autogen cabal_macros.h .hdevtools.sock
diff --git a/tests/goldenFiles/withoutSandbox/FromExeSrcFile.txt b/tests/goldenFiles/withoutSandbox/FromExeSrcFile.txt
--- a/tests/goldenFiles/withoutSandbox/FromExeSrcFile.txt
+++ b/tests/goldenFiles/withoutSandbox/FromExeSrcFile.txt
@@ -1,1 +1,1 @@
--iexe -W -optP-DEXE -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
+-iexe -W -optP-DEXE -package=base -package=cabal-cargs -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withoutSandbox/FromExeSrcFileHdevtools.txt b/tests/goldenFiles/withoutSandbox/FromExeSrcFileHdevtools.txt
--- a/tests/goldenFiles/withoutSandbox/FromExeSrcFileHdevtools.txt
+++ b/tests/goldenFiles/withoutSandbox/FromExeSrcFileHdevtools.txt
@@ -1,1 +1,1 @@
--g-iexe -g-W -g-optP-DEXE -g-idist/build/autogen -g-Idist/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
+-g-iexe -g-W -g-optP-DEXE -g-package=base -g-package=cabal-cargs -g-idist/build/autogen -g-Idist/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
diff --git a/tests/goldenFiles/withoutSandbox/FromExeSrcFilePure.txt b/tests/goldenFiles/withoutSandbox/FromExeSrcFilePure.txt
--- a/tests/goldenFiles/withoutSandbox/FromExeSrcFilePure.txt
+++ b/tests/goldenFiles/withoutSandbox/FromExeSrcFilePure.txt
@@ -1,1 +1,1 @@
-exe -W -DEXE dist/build/autogen dist/build/autogen cabal_macros.h .hdevtools.sock
+exe -W -DEXE base cabal-cargs dist/build/autogen dist/build/autogen cabal_macros.h .hdevtools.sock
diff --git a/tests/goldenFiles/withoutSandbox/FromLibSrcFile.txt b/tests/goldenFiles/withoutSandbox/FromLibSrcFile.txt
--- a/tests/goldenFiles/withoutSandbox/FromLibSrcFile.txt
+++ b/tests/goldenFiles/withoutSandbox/FromLibSrcFile.txt
@@ -1,1 +1,1 @@
--ilib -W -optP-DLIB -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
+-ilib -W -optP-DLIB -package=base -package=cmdargs -package=lens -package=directory -package=strict -package=transformers -package=either -package=text -package=system-filepath -package=system-fileio -package=Cabal -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/goldenFiles/withoutSandbox/FromLibSrcFileHdevtools.txt b/tests/goldenFiles/withoutSandbox/FromLibSrcFileHdevtools.txt
--- a/tests/goldenFiles/withoutSandbox/FromLibSrcFileHdevtools.txt
+++ b/tests/goldenFiles/withoutSandbox/FromLibSrcFileHdevtools.txt
@@ -1,1 +1,1 @@
--g-ilib -g-W -g-optP-DLIB -g-idist/build/autogen -g-Idist/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
+-g-ilib -g-W -g-optP-DLIB -g-package=base -g-package=cmdargs -g-package=lens -g-package=directory -g-package=strict -g-package=transformers -g-package=either -g-package=text -g-package=system-filepath -g-package=system-fileio -g-package=Cabal -g-idist/build/autogen -g-Idist/build/autogen -g-optP-include -g-optPcabal_macros.h --socket=.hdevtools.sock
diff --git a/tests/goldenFiles/withoutSandbox/FromLibSrcPure.txt b/tests/goldenFiles/withoutSandbox/FromLibSrcPure.txt
--- a/tests/goldenFiles/withoutSandbox/FromLibSrcPure.txt
+++ b/tests/goldenFiles/withoutSandbox/FromLibSrcPure.txt
@@ -1,1 +1,1 @@
-lib -W -DLIB dist/build/autogen dist/build/autogen cabal_macros.h .hdevtools.sock
+lib -W -DLIB base cmdargs lens directory strict transformers either text system-filepath system-fileio Cabal dist/build/autogen dist/build/autogen cabal_macros.h .hdevtools.sock
diff --git a/tests/goldenFiles/withoutSandbox/IgnoreBuildDepends.txt b/tests/goldenFiles/withoutSandbox/IgnoreBuildDepends.txt
new file mode 100644
--- /dev/null
+++ b/tests/goldenFiles/withoutSandbox/IgnoreBuildDepends.txt
@@ -0,0 +1,1 @@
+-ilib -iexe -itests -W -optP-DLIB -optP-DEXE -idist/build/autogen -Idist/build/autogen -optP-include -optPcabal_macros.h
diff --git a/tests/mkGoldens b/tests/mkGoldens
--- a/tests/mkGoldens
+++ b/tests/mkGoldens
@@ -5,7 +5,7 @@
    cabal-cargs --relative --cabalfile=inputFiles/$dir/test.cabal > goldenFiles/$dir/FromCabalFile.txt
    cabal-cargs --relative --sourcefile=inputFiles/$dir/lib/Source.hs > goldenFiles/$dir/FromLibSrcFile.txt
    cabal-cargs --relative --sourcefile=inputFiles/$dir/exe/Source.hs > goldenFiles/$dir/FromExeSrcFile.txt
-   .txt
+
    cabal-cargs --relative --format=hdevtools --sourcefile=inputFiles/$dir/lib > goldenFiles/$dir/FindCabalFileHdevtools.txt
    cabal-cargs --relative --format=hdevtools --cabalfile=inputFiles/$dir/test.cabal > goldenFiles/$dir/FromCabalFileHdevtools.txt
    cabal-cargs --relative --format=hdevtools --sourcefile=inputFiles/$dir/lib/Source.hs > goldenFiles/$dir/FromLibSrcFileHdevtools.txt
@@ -31,4 +31,7 @@
    cabal-cargs --relative --enable=default_false_flag --cabalfile=inputFiles/$dir/test.cabal > goldenFiles/$dir/EnableFlag.txt
    cabal-cargs --relative --disable=default_true_flag --cabalfile=inputFiles/$dir/test.cabal > goldenFiles/$dir/DisableFlag.txt
    cabal-cargs --relative --enable=default_false_flag --disable=default_true_flag --cabalfile=inputFiles/$dir/test.cabal > goldenFiles/$dir/EnableAndDisableFlag.txt
+
+   cabal-cargs --relative --ignore=build_depends --cabalfile=inputFiles/$dir/test.cabal > goldenFiles/$dir/IgnoreBuildDepends.txt
+   cabal-cargs --relative --allsections --sourcefile=inputFiles/$dir/exe/Source.hs > goldenFiles/$dir/AllSections.txt
 done
