From 1421fb6b0bc1e13981194babe2edfc7b233f8da6 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sun, 28 Sep 2008 03:27:17 +0000 Subject: [PATCH] remove overview.hs --- Makefile | 5 +---- tools/overview.hs | 50 ----------------------------------------------- 2 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 tools/overview.hs diff --git a/Makefile b/Makefile index 0d53df3a4..7b610091e 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,6 @@ test: docs haddock: haddock -h -o doc *.hs -overview: - @./tools/overview.hs Types.hs >OVERVIEW - loc: @darcs trackdown 'find . -name "*hs" |xargs wc -l |echo OUTPUT `tail -1`; false' |ruby -nae'puts $$F[1] if /^OUTPUT/' @@ -44,5 +41,5 @@ clean: rm -f *.o *.hi *~ 1 2 Clean: clean - rm -f hledger hledgeropt overview TAGS tags + rm -f hledger hledgeropt TAGS tags diff --git a/tools/overview.hs b/tools/overview.hs deleted file mode 100644 index 8bd7a4874..000000000 --- a/tools/overview.hs +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env runhaskell -{- -overview.hs - print an overview of functions from a given list of modules -Simon Michael 2007 - -Usage: ./overview.hs somefile - -where somefile, typically your main module, contains the word "overview" -followed by a blank-line-delimited list of module names, like so: - -firstmodule -anothermodule - submodule - -Useful for getting the big picture and refactoring. --} - -import System -import System.Process -import IO -import Data.List -import Text.Printf - -main = do - args <- getArgs - file <- readFile $ head args - let mods = takeWhile ((> 0) . length) $ - dropWhile ((== 0) . length) $ - dropWhile ((> 0) . length) $ - dropWhile (notElem "overview" . words) $ - lines file - putStr $ unlines mods - let files = concat $ map ((++ ".hs ") . dropWhile (== ' ')) mods - let grep = "grep -H '^\\w[^=]*::' " ++ files - (inp, out, err, pid) <- runInteractiveCommand grep - waitForProcess pid - grepoutput <- hGetContents out - let groups = groupBy (\a b -> samefile a b) $ lines grepoutput - sequence $ map printgroup groups - putStr "\n" - -printgroup ls = do putStr "\n"; sequence $ map printline ls - -printline l = - putStrLn $ printf "%-22s %-40s %s" (file++":") code typedecl - where - (file, rest) = break (== ':') l - (code, typedecl) = break (== ':') $ tail rest - -samefile a b = ((takeWhile (/= ':') a) ++ ":") `isPrefixOf` b