mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-02-11 13:57:31 +01:00
Added --no-platform option
This commit is contained in:
parent
b9a7065a0d
commit
dd595ab519
@ -9,15 +9,17 @@ import System.IO (hFlush, stdout)
|
|||||||
data BuildArgs = BuildArgs
|
data BuildArgs = BuildArgs
|
||||||
{ noClean :: Bool
|
{ noClean :: Bool
|
||||||
, excluded :: [String]
|
, excluded :: [String]
|
||||||
|
, noPlatform :: Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
parseBuildArgs :: [String] -> IO BuildArgs
|
parseBuildArgs :: [String] -> IO BuildArgs
|
||||||
parseBuildArgs =
|
parseBuildArgs =
|
||||||
loop $ BuildArgs False []
|
loop $ BuildArgs False [] False
|
||||||
where
|
where
|
||||||
loop x [] = return x
|
loop x [] = return x
|
||||||
loop x ("--no-clean":rest) = loop x { noClean = True } rest
|
loop x ("--no-clean":rest) = loop x { noClean = True } rest
|
||||||
loop x ("--exclude":y:rest) = loop x { excluded = y : excluded x } rest
|
loop x ("--exclude":y:rest) = loop x { excluded = y : excluded x } rest
|
||||||
|
loop x ("--no-platform":rest) = loop x { noPlatform = True } rest
|
||||||
loop _ (y:_) = error $ "Did not understand argument: " ++ y
|
loop _ (y:_) = error $ "Did not understand argument: " ++ y
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
@ -29,6 +31,7 @@ main = do
|
|||||||
build defaultBuildSettings
|
build defaultBuildSettings
|
||||||
{ cleanBeforeBuild = not noClean
|
{ cleanBeforeBuild = not noClean
|
||||||
, excludedPackages = fromList $ map PackageName excluded
|
, excludedPackages = fromList $ map PackageName excluded
|
||||||
|
, requireHaskellPlatform = not noPlatform
|
||||||
}
|
}
|
||||||
["init"] -> do
|
["init"] -> do
|
||||||
putStrLn "Note: init isn't really ready for prime time use."
|
putStrLn "Note: init isn't really ready for prime time use."
|
||||||
@ -46,5 +49,5 @@ main = do
|
|||||||
putStrLn "Available commands:"
|
putStrLn "Available commands:"
|
||||||
putStrLn " update Download updated Stackage databases. Automatically calls init."
|
putStrLn " update Download updated Stackage databases. Automatically calls init."
|
||||||
putStrLn " init Initialize your cabal file to use Stackage"
|
putStrLn " init Initialize your cabal file to use Stackage"
|
||||||
putStrLn " build [--no-clean] [--exclude package...]"
|
putStrLn " build [--no-clean] [--no-platform] [--exclude package...]"
|
||||||
putStrLn " Build the package databases (maintainers only)"
|
putStrLn " Build the package databases (maintainers only)"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user