@@ -15,9 +15,10 @@ import Data.Char ( toLower )
1515import qualified Data.List as L
1616import Data.List.NonEmpty ( prependList )
1717import Options.Applicative
18- ( Parser , ParserFailure , ParserHelp , ParserResult (.. ), flag , switch
18+ ( Parser , ParserFailure , ParserHelp , ParserResult (.. )
1919 , handleParseResult , help , helpError , idm , long , metavar
20- , overFailure , renderFailure , strArgument , switch )
20+ , overFailure , renderFailure , strArgument , switch
21+ )
2122import Options.Applicative.Help ( errorHelp , stringChunk , vcatChunks )
2223import Options.Applicative.Builder.Extra
2324 ( boolFlags , extraHelpOption )
@@ -48,10 +49,7 @@ import Stack.Exec ( SpecialExecCmd (..), execCmd )
4849import Stack.Eval ( evalCmd )
4950import Stack.Ghci ( ghciCmd )
5051import Stack.Hoogle ( hoogleCmd )
51- import Stack.IDE
52- ( ListPackagesCmd (.. ), OutputStream (.. ), idePackagesCmd
53- , ideTargetsCmd
54- )
52+ import Stack.IDE ( idePackagesCmd , ideTargetsCmd )
5553import Stack.Init ( initCmd )
5654import Stack.List ( listCmd )
5755import Stack.Ls ( lsCmd )
@@ -67,6 +65,7 @@ import Stack.Options.ExecParser ( execOptsParser )
6765import Stack.Options.GhciParser ( ghciOptsParser )
6866import Stack.Options.GlobalParser ( globalOptsParser )
6967import Stack.Options.HpcReportParser ( hpcReportOptsParser )
68+ import Stack.Options.IdeParser ( idePackagesParser , ideTargetsParser )
7069import Stack.Options.InitParser ( initOptsParser )
7170import Stack.Options.LsParser ( lsOptsParser )
7271import Stack.Options.NewParser ( newOptsParser )
@@ -358,46 +357,17 @@ commandLineHandler currentDir progName mExecutablePath isInterpreter =
358357 ide = addSubCommands'
359358 " ide"
360359 " 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
401371 )
402372
403373 init = addCommand'
0 commit comments