fix travis and make the example support several files at a time

This commit is contained in:
Alp Mestanogullari 2014-06-12 15:21:18 +02:00
parent 65d7daf3cc
commit 52d5bfb90c
3 changed files with 9 additions and 8 deletions

View File

@ -1,13 +1,13 @@
language: haskell
script:
- cabal configure --enable-benchmarks && cabal build && cabal bench
- cabal configure --enable-benchmarks && cabal build
before_install:
- cabal update
install:
- cabal install --only-dependencies --enable-benchmarks
- cabal install --only-dependencies
notifications:
email:

View File

@ -11,19 +11,18 @@ main = do
args <- getArgs
case args of
["--help"] -> usage
[opt, filename] | opt == "-d" || opt == "--dom" -> dom filename
[opt, filename] | opt == "-t" || opt == "--t" -> taggy filename
[filename] -> taggy filename
(opt : filenames) | opt == "-d" || opt == "--dom" -> mapM_ dom filenames
(opt : filenames) | opt == "-t" || opt == "--t" -> mapM_ taggy filenames
_ -> usage
usage :: IO ()
usage = do
putStrLn "taggy - simple and fast HTML parser"
putStrLn ""
putStrLn "Usage:\t taggy [OPTION] <HTML file name>"
putStrLn "Usage:\t taggy <format> file1.html file2.html file3.html ..."
putStrLn "\n"
putStrLn "Options are:"
putStrLn "\t -d/--dom\t Parse as a DOM tree. This isn't the default."
putStrLn "Formats are:"
putStrLn "\t -d/--dom\t Parse as a DOM tree."
putStrLn "\t -t/--tags\t Parse as a list of opening/closing/text/comment/script/style tags"
taggy :: FilePath -> IO ()

View File

@ -27,6 +27,7 @@ library
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -Wall -O2 -fno-warn-unused-do-bind -funbox-strict-fields
ghc-prof-options: -Wall -O2 -fno-warn-unused-do-bind -funbox-strict-fields -prof -auto-all
executable taggy
main-is: taggy.hs
@ -36,6 +37,7 @@ executable taggy
attoparsec >=0.12,
taggy
ghc-options: -Wall -O2 -fno-warn-unused-do-bind
ghc-prof-options: -Wall -prof -auto-all -O2 -fno-warn-unused-do-bind -rtsopts "-with-rtsopts=-sstderr -p"
default-language: Haskell2010
benchmark taggytagsoup