Skip to content

Commit c780f34

Browse files
committed
WIP
1 parent 0b89579 commit c780f34

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cabal-install/src/Distribution/Client/CmdStatus.hs

+5-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import Distribution.Types.UnitId
5959
import Distribution.Verbosity
6060
( normal )
6161
import Distribution.Version
62+
import Debug.Trace
6263

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

@@ -169,6 +170,7 @@ statusAction flags@NixStyleFlags { extraFlags = statusFlags, ..} cliTargetString
169170
(cabalDirLayout baseCtx)
170171
(projectConfig baseCtx)
171172
(localPackages baseCtx)
173+
(installedPackages baseCtx)
172174

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

0 commit comments

Comments
 (0)