packages feed

graphmod 1.2.1 → 1.2.2

raw patch · 2 files changed

+21/−4 lines, 2 files

Files

graphmod.cabal view
@@ -1,5 +1,5 @@ name:           graphmod-version:        1.2.1+version:        1.2.2 license:        BSD3 license-file:   LICENSE author:         Iavor S. Diatchki
src/Main.hs view
@@ -16,16 +16,25 @@ import System.Console.GetOpt import Numeric(showHex) +import Paths_graphmod (version)+import Data.Version (showVersion)+ main :: IO () main = do xs <- getArgs           let (fs, ms, errs) = getOpt Permute options xs           case errs of-            [] -> do let opts = foldr ($) default_opts fs-                     g <- graph (add_current opts) (map to_input ms)+            [] | show_version opts ->+                  putStrLn ("graphmod " ++ showVersion version)++               | otherwise ->+                  do g <- graph (add_current opts) (map to_input ms)                      putStrLn (make_dot (use_clusters opts) g)-            _ -> hPutStrLn stderr $ usageInfo "mods" options+              where opts = foldr ($) default_opts fs +            _ -> hPutStrLn stderr $+                  usageInfo "usage: graphmod MODULES/PATHS" options + data Input  = File FilePath | Module ModName  -- | Guess if we have a file or a module name@@ -231,6 +240,7 @@   , use_clusters  :: Bool   , ignore_mods   :: IgnoreSet   , collapse_quals :: Trie.Trie String ()+  , show_version  :: Bool   }  type IgnoreSet  = Trie.Trie String IgnoreSpec@@ -246,6 +256,7 @@   , use_clusters  = True   , ignore_mods   = Trie.empty   , collapse_quals = Trie.empty+  , show_version    = False   }  options :: [OptDescr OptT]@@ -270,6 +281,9 @@    , Option ['c'] ["collapse"]   (ReqArg add_collapse_qual "QUALIFIER")     "Display modules matching the qualifier as a single node."++  , Option ['v'] ["version"]   (NoArg set_show_version)+    "Display the current version."   ]  add_current      :: OptT@@ -279,6 +293,9 @@  set_quiet        :: OptT set_quiet o       = o { quiet = True }++set_show_version :: OptT+set_show_version o = o { show_version = True }  set_all          :: OptT set_all o         = o { with_missing = True }