on master help sign in
print every subdir of libdir as a package
7cef7eaNorbert Melzer
idris.cabal+1
@@ -794,6 +794,7 @@ Executable idris
794 Build-depends: idris
794 Build-depends: idris
795 , base
795 , base
796 , filepath
796 , filepath
797+ , directory
797 , haskeline >= 0.7
798 , haskeline >= 0.7
798 , transformers
799 , transformers
799
800
main/Main.hs+8
@@ -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
96+
97+-- | List idris packages installed
98+showPkgs :: IO b
99+showPkgs = do dir <- getIdrisLibDir
100+ pkgs <- getDirectoryContents dir
101+ mapM putStrLn (filter (/= ".") . filter (/= "..") $ pkgs)
102+ exitWith ExitSuccess