diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-21 22:12:48 +0900 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-21 22:12:48 +0900 |
commit | 142777bec6952ff80be57710255be028cc97a0f2 (patch) | |
tree | 216bf623d25a0fc14e98e69b8c0c106d104a7db0 /src | |
parent | 59105254b0c3c628ae876d91ce17ea8ff3ea75e5 (diff) | |
download | sariulclocks-142777bec6952ff80be57710255be028cc97a0f2.tar.gz |
sariulccron takes directory to work in as command line argument
Diffstat (limited to 'src')
-rw-r--r-- | src/sariulccron.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sariulccron.hs b/src/sariulccron.hs index 7aad948..07cef40 100644 --- a/src/sariulccron.hs +++ b/src/sariulccron.hs @@ -8,6 +8,8 @@ import Data.Classes import Data.Function (on) import Data.List (sortBy) import Data.Maybe (fromJust) +import System.Directory (setCurrentDirectory) +import System.Environment (getArgs) import Text.PrettyPrint.Boxes import Types.Classes import Types.Scores @@ -33,6 +35,7 @@ resetTime (c, Score x _) = (c, Score x 0) main :: IO () main = runSariulClocksIO $ do + liftIO $ liftM head getArgs >>= setCurrentDirectory scores <- readScoresFile -- Proceed only if we actually read some scores. when (isJust scores) $ do |