Skip to content

Commit

Permalink
print every subdir of libdir as a package
Browse files Browse the repository at this point in the history
This is a quick and dirty solution for idris-lang#1071.

I wish I were able to implement output of metadata, but since there is
no metadata saved (currently) alongside of a package, there is nothing
to display.

Displaying metadata in the output of this subcommand would mean that
there have to happen further improvements in the package-system of
idris.

Please see my proposal in idris-lang#1126.
  • Loading branch information
NobbZ committed Jan 2, 2015
1 parent 7fedc76 commit 7cef7ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions idris.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ Executable idris
Build-depends: idris
, base
, filepath
, directory
, haskeline >= 0.7
, transformers

Expand Down
8 changes: 8 additions & 0 deletions main/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 7cef7ea

Please sign in to comment.