From 617e9a8936534dd2aabba2c473ea67cac3c14526 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 12 Dec 2007 10:22:30 +0000 Subject: [PATCH] "list --simple-output" should be quiet when there are no packages to list Previously: $ ghc-pkg list --user --simple-output ghc-pkg: no matches $ Now: $ ghc-pkg list --user --simple-output $ --- utils/ghc-pkg/Main.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index feb88cb..ef5cb39 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -506,8 +506,8 @@ listPackages flags mPackageName mModuleName = do else showPackageId pkgs = map showPkg $ sortBy compPkgIdVer $ map package (concatMap snd db_stack) - when (null pkgs) $ die "no matches" - hPutStrLn stdout $ concat $ intersperse " " pkgs + when (not (null pkgs)) $ + hPutStrLn stdout $ concat $ intersperse " " pkgs -- ----------------------------------------------------------------------------- -- Prints the highest (hidden or exposed) version of a package -- 1.7.10.4