Skip to content

Commit 98734d2

Browse files
committed
Add explicit import lists to Stack.Options.CleanParser
Also, some reformatting.
1 parent 37520d7 commit 98734d2

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

src/Stack/Options/CleanParser.hs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
{-# LANGUAGE NoImplicitPrelude #-}
22

3-
module Stack.Options.CleanParser where
3+
module Stack.Options.CleanParser
4+
( cleanOptsParser
5+
) where
46

5-
import Options.Applicative
6-
import Stack.Clean (CleanCommand(..), CleanOpts (..))
7+
import Options.Applicative ( Parser, flag', help, long, metavar )
8+
import Stack.Clean ( CleanCommand (..), CleanOpts (..) )
79
import Stack.Prelude
8-
import Stack.Types.PackageName
10+
import Stack.Types.PackageName ( packageNameArgument )
911

1012
-- | Command-line parser for the clean command.
1113
cleanOptsParser :: CleanCommand -> Parser CleanOpts
12-
cleanOptsParser Clean = CleanShallow <$> packages <|> doFullClean
13-
where
14-
packages =
15-
many
16-
(packageNameArgument
17-
(metavar "PACKAGE" <>
18-
help "If none specified, clean all project packages"))
19-
doFullClean =
20-
flag'
21-
CleanFull
22-
(long "full" <>
23-
help "Delete the project’s Stack working directories (.stack-work by default).")
14+
cleanOptsParser Clean = CleanShallow
15+
<$> packages
16+
<|> doFullClean
17+
where
18+
packages = many (packageNameArgument
19+
( metavar "PACKAGE"
20+
<> help "If none specified, clean all project packages"
21+
))
22+
doFullClean = flag' CleanFull
23+
( long "full"
24+
<> help "Delete the project's Stack working directories (.stack-work by \
25+
\default)."
26+
)
2427

2528
cleanOptsParser Purge = pure CleanFull

0 commit comments

Comments
 (0)