@@ -59,6 +59,7 @@ import Distribution.Types.UnitId
59
59
import Distribution.Verbosity
60
60
( normal )
61
61
import Distribution.Version
62
+ import Debug.Trace
62
63
63
64
-------------------------------------------------------------------------------
64
65
-- Command
@@ -158,7 +159,7 @@ statusOptions showOrParseArgs =
158
159
statusAction :: NixStyleFlags StatusFlags -> [String ] -> GlobalFlags -> IO ()
159
160
statusAction flags@ NixStyleFlags { extraFlags = statusFlags, .. } cliTargetStrings globalFlags = do
160
161
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'. "
162
163
when (not $ null cliTargetStrings) $
163
164
die' verbosity " The status command doesn't take target arguments directly. Use appropriate flags to pass in target information."
164
165
@@ -169,6 +170,7 @@ statusAction flags@NixStyleFlags { extraFlags = statusFlags, ..} cliTargetString
169
170
(cabalDirLayout baseCtx)
170
171
(projectConfig baseCtx)
171
172
(localPackages baseCtx)
173
+ (installedPackages baseCtx)
172
174
173
175
compilerInformation <- if not $ fromFlagOrDefault False (statusCompiler statusFlags)
174
176
then pure Nothing
@@ -186,13 +188,15 @@ statusAction flags@NixStyleFlags { extraFlags = statusFlags, ..} cliTargetString
186
188
then pure Nothing
187
189
else do
188
190
let targetStrings = statusTargets statusFlags
191
+ traceShowM targetStrings
189
192
mtargetSelectors <- mapM (readTargetSelector (localPackages baseCtx) Nothing ) targetStrings
190
193
let (unresolvable, targetSelectors) = partitionEithers
191
194
$ map (\ (mts, str) -> case mts of
192
195
Left _ -> Left str
193
196
Right ts -> Right (ts, str)
194
197
)
195
198
$ zip mtargetSelectors targetStrings
199
+ traceShowM mtargetSelectors
196
200
-- Interpret the targets on the command line as build targets
197
201
-- (as opposed to say repl or haddock targets).
198
202
-- TODO: don't throw on targets that are invalid.
0 commit comments