@@ -5,6 +5,7 @@ import System.IO
55import System.Environment
66import System.Exit
77import System.FilePath ((</>), addTrailingPathSeparator)
8+import System.Directory
89
910import Data.Maybe
1011import Data.Version
@@ -45,6 +46,7 @@ runIdris opts = do
4546 when (ShowIncs `elem` opts) $ runIO showIncs
4647 when (ShowLibs `elem` opts) $ runIO showLibs
4748 when (ShowLibdir `elem` opts) $ runIO showLibdir
49+ when (ShowPkgs `elem` opts) $ runIO showPkgs
4850 case opt getClient opts of
4951 [] -> return ()
5052 (c:_) -> do setVerbose False
@@ -92,3 +94,10 @@ showIncs :: IO b
9294showIncs = do incFlags <- getIncFlags
9395 putStrLn $ unwords incFlags
9496 exitWith ExitSuccess
97+
98+-- | List idris packages installed
99+showPkgs :: IO b
100+showPkgs = do dir <- getIdrisLibDir
101+ pkgs <- getDirectoryContents dir
102+ mapM putStrLn (filter (/= ".") . filter (/= "..") $ pkgs)
103+ exitWith ExitSuccess