[project @ 2005-01-20 16:15:02 by simonmar]
authorsimonmar <unknown>
Thu, 20 Jan 2005 16:15:02 +0000 (16:15 +0000)
committersimonmar <unknown>
Thu, 20 Jan 2005 16:15:02 +0000 (16:15 +0000)
ghc-pkg list: show hidden packages in parentheses

ghc/utils/ghc-pkg/Main.hs

index 477028c..a3aa329 100644 (file)
@@ -387,8 +387,10 @@ listPackages db_confs = do
                text (db_name ++ ":") $$ nest 4 packages
                )
           where packages = fsep (punctuate comma (map pp_pkg pkg_confs))
-                pp_pkg = text . showPackageId . package
-
+                pp_pkg p
+                  | exposed p = doc
+                  | otherwise = parens doc
+                  where doc = text (showPackageId (package p))
 
 -- -----------------------------------------------------------------------------
 -- Describe