Browse code
getting cabalized
Ed L authored on 27/04/2013 02:53:40
Showing 5 changed files
Showing 5 changed files
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,14 @@ |
1 |
+name: RingReader |
|
2 |
+version: 0.1 |
|
3 |
+synopsis: a ring buffer output filter |
|
4 |
+author: Edward Langley |
|
5 |
+license: MIT |
|
6 |
+build-type: Simple |
|
7 |
+cabal-version: >= 1.16 |
|
8 |
+ |
|
9 |
+executable ring_reader |
|
10 |
+ build-depends: cmdargs,hscurses,base,transformers,mtl,process |
|
11 |
+ default-language: Haskell2010 |
|
12 |
+ main-is: RingReader.hs |
|
13 |
+ hs-source-dirs: src |
|
14 |
+ |
0 | 4 |
deleted file mode 100644 |
... | ... |
@@ -1,13 +0,0 @@ |
1 |
-name: ring_reader |
|
2 |
-version: 0.1 |
|
3 |
-synopsis: a ring buffer output filter |
|
4 |
-author: Edward Langley |
|
5 |
-license: MIT |
|
6 |
-build-type: Simple |
|
7 |
-cabal-version: >= 1.16 |
|
8 |
- |
|
9 |
-executable program1 |
|
10 |
- build-depends: CmdArgs,HSCurses |
|
11 |
- main-is: ring_reader.hs |
|
12 |
- hs-source-dirs: . |
|
13 |
- |
16 | 2 |
similarity index 96% |
17 | 3 |
rename from src/ring_reader.hs |
18 | 4 |
rename to src/RingReader.hs |
... | ... |
@@ -1,9 +1,13 @@ |
1 | 1 |
{-# LANGUAGE DeriveDataTypeable, RecordWildCards #-} |
2 | 2 |
|
3 |
+module Main where |
|
4 |
+ |
|
3 | 5 |
import System.IO |
4 | 6 |
import System.Process |
5 | 7 |
import System.Environment |
6 | 8 |
import System.Console.CmdArgs |
9 |
+import System.Exit |
|
10 |
+ |
|
7 | 11 |
|
8 | 12 |
import Control.Concurrent |
9 | 13 |
|
... | ... |
@@ -122,6 +126,7 @@ main = do |
122 | 126 |
|
123 | 127 |
optionHandler :: MyOptions -> IO () |
124 | 128 |
optionHandler opts@MyOptions{..} = do |
129 |
+ when (null run) $ putStrLn "No Command to Run!" >> exitWith (ExitFailure 1) |
|
125 | 130 |
Exception.bracket_ allocate deallocate (work encoding run infinite) |
126 | 131 |
|
127 | 132 |
-- mainloop = runST $ do |