packages feed

viewprof 0.0.0.12 → 0.0.0.13

raw patch · 3 files changed

+35/−5 lines, 3 filesdep +directorydep ~brick

Dependencies added: directory

Dependency ranges changed: brick

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for viewprof +## 0.0.0.13 - 2018-01-22++* Relax upper version bound for brick+ ## 0.0.0.12 - 2017-12-12  * Relax upper version bound for vty
bin/viewprof.hs view
@@ -12,9 +12,11 @@ import Control.Monad import Data.Foldable import Data.Function (on)-import Data.List.NonEmpty+import Data.List.NonEmpty hiding (head, length) import Data.Maybe+import System.Directory (doesFileExist) import System.Environment+import System.Exit (exitFailure) import Text.Printf import qualified Data.List.NonEmpty as NE @@ -71,10 +73,33 @@   | ModulesCache !Int   deriving (Eq, Ord, Show) +data Args = Args+  { profilePath :: FilePath+  }++usage :: IO a+usage = do+  pn <- getProgName+  putStrLn $ "Usage: " ++ pn ++ " <file.prof>"+  exitFailure++parseArgs :: IO Args+parseArgs = do+  args <- getArgs+  case args of+    [arg] -> validateArgs (Args arg)+    _ -> usage+  where+    validateArgs :: Args -> IO Args+    validateArgs args = do+      b <- doesFileExist (profilePath args)+      unless b usage+      pure args+ main :: IO () main = do-  path:_ <- getArgs-  profile <- parseProfile path+  args <- parseArgs+  profile <- parseProfile $ profilePath args   void $ defaultMain app profile  parseProfile :: FilePath -> IO Profile
viewprof.cabal view
@@ -1,5 +1,5 @@ name: viewprof-version: 0.0.0.12+version: 0.0.0.13 synopsis: Text-based interactive GHC .prof viewer description: Text-based interactive GHC .prof viewer homepage: https://github.com/maoe/viewprof@@ -22,8 +22,9 @@   main-is: viewprof.hs   build-depends:       base >= 4.9 && < 4.11-    , brick >= 0.16 && < 0.30+    , brick >= 0.16 && < 0.34     , containers >= 0.5.7 && < 0.6+    , directory >= 1.3 && < 1.4     , ghc-prof >= 1.4 && < 1.5     , lens >= 4.14 && < 4.16     , scientific >= 0.3.4.4 && < 0.4