1
1
{-# LANGUAGE NoImplicitPrelude #-}
2
+ {-# LANGUAGE ApplicativeDo #-}
2
3
{-# LANGUAGE OverloadedStrings #-}
3
4
4
5
-- | Function to parse command line arguments for Stack's @ls@ command.
@@ -19,7 +20,7 @@ import Stack.Ls
19
20
, LsView (.. ), SnapshotOpts (.. ), ListGlobalsOpts
20
21
)
21
22
import Stack.Options.DotParser ( dotOptsParser )
22
- import Stack.Prelude
23
+ import Stack.Prelude hiding ( sep )
23
24
24
25
-- | Parse command line arguments for Stack's @ls@ command.
25
26
lsOptsParser :: OA. Parser LsCmdOpts
@@ -48,9 +49,9 @@ lsDepsCmd :: OA.Mod OA.CommandFields LsCmds
48
49
lsDepsCmd = OA. command " dependencies" $
49
50
OA. info lsDepOptsParser $
50
51
OA. progDesc
51
- " View the packages and versions used for a project. Use a command if \
52
- \the first target specified has the name of a command. Targets other \
53
- \than project packages are ignored."
52
+ " View the packages versions used for a project. Use a command if the \
53
+ \first target specified has the name of a command. Targets other than \
54
+ \project packages are ignored."
54
55
<> OA. footer globalFooter
55
56
56
57
lsStylesCmd :: OA. Mod OA. CommandFields LsCmds
@@ -193,17 +194,21 @@ listDepsJsonParser :: OA.Parser ListDepsFormat
193
194
listDepsJsonParser = pure ListDepsJSON
194
195
195
196
listDepsFormatOptsParser :: OA. Parser ListDepsFormatOpts
196
- listDepsFormatOptsParser = ListDepsFormatOpts
197
- <$> separatorParser
198
- <*> licenseParser
197
+ listDepsFormatOptsParser = do
198
+ license <- licenseParser
199
+ sep <- separatorParser
200
+ pure ListDepsFormatOpts
201
+ { sep
202
+ , license
203
+ }
199
204
200
205
separatorParser :: OA. Parser Text
201
206
separatorParser = fmap
202
207
escapeSep
203
208
( textOption
204
209
( OA. long " separator"
205
210
<> OA. metavar " SEP"
206
- <> OA. help " Separator between package name and package version ."
211
+ <> OA. help " Separator between package name and what follows ."
207
212
<> OA. value " "
208
213
<> OA. showDefault
209
214
)
0 commit comments