@@ -45,6 +45,7 @@ runIdris opts = do
45 when (ShowIncs `elem` opts) $ runIO showIncs
45 when (ShowIncs `elem` opts) $ runIO showIncs
46 when (ShowLibs `elem` opts) $ runIO showLibs
46 when (ShowLibs `elem` opts) $ runIO showLibs
47 when (ShowLibdir `elem` opts) $ runIO showLibdir
47 when (ShowLibdir `elem` opts) $ runIO showLibdir
48+ when (ShowPkgs `elem` opts) $ runIO showPkgs
48 case opt getClient opts of
49 case opt getClient opts of
49 [] -> return ()
50 [] -> return ()
50 (c:_) -> do setVerbose False
51 (c:_) -> do setVerbose False
@@ -92,3 +93,10 @@ showIncs :: IO b
92showIncs = do incFlags <- getIncFlags
93showIncs = do incFlags <- getIncFlags
93 putStrLn $ unwords incFlags
94 putStrLn $ unwords incFlags
94 exitWith ExitSuccess
95 exitWith ExitSuccess
97+-- | List idris packages installed
99+showPkgs = do dir <- getIdrisLibDir
100+ pkgs <- getDirectoryContents dir
101+ mapM putStrLn (filter (/= ".") . filter (/= "..") $ pkgs)
102+ exitWith ExitSuccess