Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fendor committed Jan 23, 2023
1 parent 0b89579 commit c780f34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cabal-install/src/Distribution/Client/CmdStatus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import Distribution.Types.UnitId
import Distribution.Verbosity
( normal )
import Distribution.Version
import Debug.Trace

-------------------------------------------------------------------------------
-- Command
Expand Down Expand Up @@ -158,7 +159,7 @@ statusOptions showOrParseArgs =
statusAction :: NixStyleFlags StatusFlags -> [String] -> GlobalFlags -> IO ()
statusAction flags@NixStyleFlags { extraFlags = statusFlags, ..} cliTargetStrings globalFlags = do
when (NoFlag == statusOutputFormat statusFlags) $ do
die' verbosity "The status command requires the flag '--output-format'."
die' verbosity "The status command requires the flag '--output-format'. Try '--output-format=json'."
when (not $ null cliTargetStrings) $
die' verbosity "The status command doesn't take target arguments directly. Use appropriate flags to pass in target information."

Expand All @@ -169,6 +170,7 @@ statusAction flags@NixStyleFlags { extraFlags = statusFlags, ..} cliTargetString
(cabalDirLayout baseCtx)
(projectConfig baseCtx)
(localPackages baseCtx)
(installedPackages baseCtx)

compilerInformation <- if not $ fromFlagOrDefault False (statusCompiler statusFlags)
then pure Nothing
Expand All @@ -186,13 +188,15 @@ statusAction flags@NixStyleFlags { extraFlags = statusFlags, ..} cliTargetString
then pure Nothing
else do
let targetStrings = statusTargets statusFlags
traceShowM targetStrings
mtargetSelectors <- mapM (readTargetSelector (localPackages baseCtx) Nothing) targetStrings
let (unresolvable, targetSelectors) = partitionEithers
$ map (\(mts, str) -> case mts of
Left _ -> Left str
Right ts -> Right (ts, str)
)
$ zip mtargetSelectors targetStrings
traceShowM mtargetSelectors
-- Interpret the targets on the command line as build targets
-- (as opposed to say repl or haddock targets).
-- TODO: don't throw on targets that are invalid.
Expand Down

0 comments on commit c780f34

Please sign in to comment.