forked from commercialhaskell/stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCleanParser.hs
More file actions
28 lines (24 loc) · 848 Bytes
/
CleanParser.hs
File metadata and controls
28 lines (24 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{-# LANGUAGE NoImplicitPrelude #-}
module Stack.Options.CleanParser
( cleanOptsParser
) where
import Options.Applicative ( Parser, flag', help, long, metavar )
import Stack.Clean ( CleanCommand (..), CleanOpts (..) )
import Stack.Prelude
import Stack.Types.PackageName ( packageNameArgument )
-- | Command-line parser for the clean command.
cleanOptsParser :: CleanCommand -> Parser CleanOpts
cleanOptsParser Clean = CleanShallow
<$> packages
<|> doFullClean
where
packages = many (packageNameArgument
( metavar "PACKAGE"
<> help "If none specified, clean all project packages."
))
doFullClean = flag' CleanFull
( long "full"
<> help "Delete the project's Stack working directories (.stack-work by \
\default)."
)
cleanOptsParser Purge = pure CleanFull