@@ -15,9 +15,10 @@ import Data.Char ( toLower )
15
15
import qualified Data.List as L
16
16
import Data.List.NonEmpty ( prependList )
17
17
import Options.Applicative
18
- ( Parser , ParserFailure , ParserHelp , ParserResult (.. ), flag , switch
18
+ ( Parser , ParserFailure , ParserHelp , ParserResult (.. )
19
19
, handleParseResult , help , helpError , idm , long , metavar
20
- , overFailure , renderFailure , strArgument , switch )
20
+ , overFailure , renderFailure , strArgument , switch
21
+ )
21
22
import Options.Applicative.Help ( errorHelp , stringChunk , vcatChunks )
22
23
import Options.Applicative.Builder.Extra
23
24
( boolFlags , extraHelpOption )
@@ -48,10 +49,7 @@ import Stack.Exec ( SpecialExecCmd (..), execCmd )
48
49
import Stack.Eval ( evalCmd )
49
50
import Stack.Ghci ( ghciCmd )
50
51
import Stack.Hoogle ( hoogleCmd )
51
- import Stack.IDE
52
- ( ListPackagesCmd (.. ), OutputStream (.. ), idePackagesCmd
53
- , ideTargetsCmd
54
- )
52
+ import Stack.IDE ( idePackagesCmd , ideTargetsCmd )
55
53
import Stack.Init ( initCmd )
56
54
import Stack.List ( listCmd )
57
55
import Stack.Ls ( lsCmd )
@@ -67,6 +65,7 @@ import Stack.Options.ExecParser ( execOptsParser )
67
65
import Stack.Options.GhciParser ( ghciOptsParser )
68
66
import Stack.Options.GlobalParser ( globalOptsParser )
69
67
import Stack.Options.HpcReportParser ( hpcReportOptsParser )
68
+ import Stack.Options.IdeParser ( idePackagesParser , ideTargetsParser )
70
69
import Stack.Options.InitParser ( initOptsParser )
71
70
import Stack.Options.LsParser ( lsOptsParser )
72
71
import Stack.Options.NewParser ( newOptsParser )
@@ -358,46 +357,17 @@ commandLineHandler currentDir progName mExecutablePath isInterpreter =
358
357
ide = addSubCommands'
359
358
" ide"
360
359
" IDE-specific commands."
361
- ( let outputFlag = flag
362
- OutputLogInfo
363
- OutputStdout
364
- ( long " stdout"
365
- <> help " Send output to the standard output stream instead of the \
366
- \default, the standard error stream."
367
- )
368
- cabalFileFlag = flag
369
- ListPackageNames
370
- ListPackageCabalFiles
371
- ( long " cabal-files"
372
- <> help " Print paths to package Cabal files instead of package \
373
- \names."
374
- )
375
- exeFlag = switch
376
- ( long " exes"
377
- <> help " Include executables."
378
- )
379
- testFlag = switch
380
- ( long " tests"
381
- <> help " Include test suites."
382
- )
383
- benchFlag = switch
384
- ( long " benchmarks"
385
- <> help " Include benchmarks."
386
- )
387
- in do
388
- addCommand'
389
- " packages"
390
- " List all available local loadable packages."
391
- idePackagesCmd
392
- ((,) <$> outputFlag <*> cabalFileFlag)
393
- addCommand'
394
- " targets"
395
- " List all targets or pick component types to list."
396
- ideTargetsCmd
397
- ( (,)
398
- <$> ((,,) <$> exeFlag <*> testFlag <*> benchFlag)
399
- <*> outputFlag
400
- )
360
+ ( do
361
+ addCommand'
362
+ " packages"
363
+ " List all available local loadable packages."
364
+ idePackagesCmd
365
+ idePackagesParser
366
+ addCommand'
367
+ " targets"
368
+ " List all targets or pick component types to list."
369
+ ideTargetsCmd
370
+ ideTargetsParser
401
371
)
402
372
403
373
init = addCommand'
0 commit comments