diff --git a/idris.cabal b/idris.cabal index cdc18d314b..8186abdbdd 100644 --- a/idris.cabal +++ b/idris.cabal @@ -794,6 +794,7 @@ Executable idris Build-depends: idris , base , filepath + , directory , haskeline >= 0.7 , transformers diff --git a/main/Main.hs b/main/Main.hs index a2e49dd2c2..6fb56eb301 100644 --- a/main/Main.hs +++ b/main/Main.hs @@ -45,6 +45,7 @@ runIdris opts = do when (ShowIncs `elem` opts) $ runIO showIncs when (ShowLibs `elem` opts) $ runIO showLibs when (ShowLibdir `elem` opts) $ runIO showLibdir + when (ShowPkgs `elem` opts) $ runIO showPkgs case opt getClient opts of [] -> return () (c:_) -> do setVerbose False @@ -92,3 +93,10 @@ showIncs :: IO b showIncs = do incFlags <- getIncFlags putStrLn $ unwords incFlags exitWith ExitSuccess + +-- | List idris packages installed +showPkgs :: IO b +showPkgs = do dir <- getIdrisLibDir + pkgs <- getDirectoryContents dir + mapM putStrLn (filter (/= ".") . filter (/= "..") $ pkgs) + exitWith ExitSuccess